summaryrefslogtreecommitdiffstats
path: root/redhat/extras/htdig/patches/gcc-11
blob: 09c974ceaa7e88681a6e610eb74b19693f736b1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
Index: b/htword/WordBitCompress.cc
===================================================================
--- a/htword/WordBitCompress.cc
+++ b/htword/WordBitCompress.cc
@@ -29,7 +29,7 @@
 #include"WordBitCompress.h"
 
 // ******** HtVector_byte (implementation)
-#define GType byte
+#define GType byte_t
 #define HtVectorGType HtVector_byte
 #include "HtVectorGenericCode.h"
 
@@ -424,13 +424,13 @@
 // **************************************************
 
 void 
-BitStream::put_zone(byte *vals,int n,const char *tag)
+BitStream::put_zone(byte_t *vals,int n,const char *tag)
 {
     add_tag(tag);
     for(int i=0;i<(n+7)/8;i++){put_uint(vals[i],TMin(8,n-8*i),NULL);}
 }
 void 
-BitStream::get_zone(byte *vals,int n,const char *tag)
+BitStream::get_zone(byte_t *vals,int n,const char *tag)
 {
     check_tag(tag);
     for(int i=0;i<(n+7)/8;i++){vals[i]=get_uint(TMin(8,n-8*i));}
@@ -699,16 +699,16 @@
     if(all){printf("\n");}
 
 }
-byte *
+byte_t *
 BitStream::get_data()
 {
-    byte *res=(byte *)malloc(buff.size());
+    byte_t *res=(byte_t *)malloc(buff.size());
     CHECK_MEM(res);
     for(int i=0;i<buff.size();i++){res[i]=buff[i];}
     return(res);
 }
 void 
-BitStream::set_data(const byte *nbuff,int nbits)
+BitStream::set_data(const byte_t *nbuff,int nbits)
 {
     if(buff.size()!=1 || bitpos!=0)
     {
@@ -835,7 +835,7 @@
 
 
 int 
-Compressor::put_fixedbitl(byte *vals,int n,const char *tag)
+Compressor::put_fixedbitl(byte_t *vals,int n,const char *tag)
 {
     int cpos=bitpos;
     int i,j;
@@ -844,19 +844,19 @@
     put_uint_vl(n,NBITS_NVALS,"size");
     if(n==0){return 0;}
 
-    byte maxv=vals[0];
+    byte_t maxv=vals[0];
     for(i=1;i<n;i++)
     {
-	byte v=vals[i];
+	byte_t v=vals[i];
 	if(v>maxv){maxv=v;}
     }
     int nbits=num_bits(maxv);
-    if(n>=pow2(NBITS_NVALS)){errr("Compressor::put_fixedbitl(byte *) : overflow: nvals>2^16");}
+    if(n>=pow2(NBITS_NVALS)){errr("Compressor::put_fixedbitl(byte_t *) : overflow: nvals>2^16");}
     put_uint(nbits,NBITS_NBITS_CHARVAL,"nbits");
     add_tag("data");
     for(i=0;i<n;i++)
     {
-	byte v=vals[i];
+	byte_t v=vals[i];
 	for(j=0;j<nbits;j++) {put(v&pow2(j));}
     }	
     return(bitpos-cpos);
@@ -887,15 +887,15 @@
     }
 }
 int 
-Compressor::get_fixedbitl(byte **pres,const char *tag/*="BADTAG!"*/)
+Compressor::get_fixedbitl(byte_t **pres,const char *tag/*="BADTAG!"*/)
 {
-    if(check_tag(tag)==NOTOK){errr("Compressor::get_fixedbitl(byte *): check_tag failed");}
+    if(check_tag(tag)==NOTOK){errr("Compressor::get_fixedbitl(byte_t *): check_tag failed");}
     int n=get_uint_vl(NBITS_NVALS);
     if(!n){*pres=NULL;return 0;}
     int nbits=get_uint(NBITS_NBITS_CHARVAL);
-    if(verbose)printf("get_fixedbitl(byte):n%3d nbits:%2d\n",n,nbits);
+    if(verbose)printf("get_fixedbitl(byte_t):n%3d nbits:%2d\n",n,nbits);
     int i;
-    byte *res=new byte[n];
+    byte_t *res=new byte_t[n];
     CHECK_MEM(res);
     for(i=0;i<n;i++)
     {
Index: b/htword/WordBitCompress.h
===================================================================
--- a/htword/WordBitCompress.h
+++ b/htword/WordBitCompress.h
@@ -28,9 +28,9 @@
 #include"HtVector_int.h"
 #include"HtMaxMin.h"
 
-typedef unsigned char byte;
+typedef unsigned char byte_t;
 // ******** HtVector_byte (header)
-#define GType byte
+#define GType byte_t
 #define HtVectorGType HtVector_byte
 #include "HtVectorGeneric.h"
 
@@ -123,12 +123,12 @@
     }
 
     // gets a bit from the bitstream
-    inline byte get(const char *tag=(char*)NULL)
+    inline byte_t get(const char *tag=(char*)NULL)
     {
 	// SPEED CRITICAL SECTION
 	if(check_tag(tag)==NOTOK){errr("BitStream::get() check_tag failed");}
 	if(bitpos>=(buff.size()<<3)){errr("BitStream::get reading past end of BitStream!");}
-	byte res=buff[bitpos>>3] & pow2(bitpos & 0x07);
+	byte_t res=buff[bitpos>>3] & pow2(bitpos & 0x07);
 //  	printf("get:res:%d bitpos:%5d/%d buff[%3d]=%x\n",res,bitpos,bitpos%8,bitpos/8,buff[bitpos/8]);
 	bitpos++;
 	return(res);
@@ -139,8 +139,8 @@
     unsigned int get_uint(               int n,const char *tag=(char*)NULL);
 
     // get/put n bits of data stored in vals
-    void put_zone(byte *vals,int n,const char *tag);
-    void get_zone(byte *vals,int n,const char *tag);
+    void put_zone(byte_t *vals,int n,const char *tag);
+    void get_zone(byte_t *vals,int n,const char *tag);
 
     // 
     inline void add_tag(const char *tag)
@@ -167,9 +167,9 @@
     int buffsize(){return(buff.size());}
 
     // get a copy of the buffer
-    byte *get_data();
+    byte_t *get_data();
     // set the buffer from outside data (current buffer must be empty)
-    void set_data(const byte *nbuff,int nbits);
+    void set_data(const byte_t *nbuff,int nbits);
       
     // use this for reading a BitStream after you have written in it 
     // (generally for debuging)
@@ -211,7 +211,7 @@
 #define NBITS_VAL 32
 // number of bits to code he number of bits used by an unsigned int value
 #define NBITS_NBITS_VAL  5
-// number of bits to code the number of bits used by a byte value
+// number of bits to code the number of bits used by a byte_t value
 #define NBITS_NBITS_CHARVAL 4
 
 class Compressor : public BitStream
@@ -240,8 +240,8 @@
     int get_vals(unsigned int **pres,const char *tag=(char*)"BADTAG!");
 
     // compress/decompress an array of bytes (very simple)
-    int put_fixedbitl(byte *vals,int n,const char *tag);    
-    int get_fixedbitl(byte **pres,const char *tag=(char*)"BADTAG!");
+    int put_fixedbitl(byte_t *vals,int n,const char *tag);
+    int get_fixedbitl(byte_t **pres,const char *tag=(char*)"BADTAG!");
 
     // compress/decompress an array of unsigned ints (very simple)
     void get_fixedbitl(unsigned int *res,int n);
Index: b/htword/WordDBPage.cc
===================================================================
--- a/htword/WordDBPage.cc
+++ b/htword/WordDBPage.cc
@@ -155,7 +155,7 @@
 	Uncompress_main(pin);
 	break;
     case CMPRTYPE_BADCOMPRESS:// this page did not compress correctly
-	pin->get_zone((byte *)pg,pgsz*8,"INITIALBUFFER");
+	pin->get_zone((byte_t *)pg,pgsz*8,"INITIALBUFFER");
 	break;
     default:
 	errr("WordDBPage::Uncompress: CMPRTYPE incoherent");
@@ -181,7 +181,7 @@
     int *rnum_sizes=new int[nnums];
     CHECK_MEM(rnum_sizes);
     // char differences between words
-    byte *rworddiffs=NULL;
+    byte_t *rworddiffs=NULL;
     int nrworddiffs;
 
     // *********** read header
@@ -288,7 +288,7 @@
     return OK;
 }
 void 
-WordDBPage::Uncompress_rebuild(unsigned int **rnums,int *rnum_sizes,int nnums0,byte *rworddiffs,int nrworddiffs)
+WordDBPage::Uncompress_rebuild(unsigned int **rnums,int *rnum_sizes,int nnums0,byte_t *rworddiffs,int nrworddiffs)
 {
     int irwordiffs=0;
     int nfields=WordKey::NFields();
@@ -405,7 +405,7 @@
 
 // display
 void 
-WordDBPage::Uncompress_show_rebuild(unsigned int **rnums,int *rnum_sizes,int nnums0,byte *rworddiffs,int nrworddiffs)
+WordDBPage::Uncompress_show_rebuild(unsigned int **rnums,int *rnum_sizes,int nnums0,byte_t *rworddiffs,int nrworddiffs)
 {
     int i,j;
     if(verbose)
@@ -464,7 +464,7 @@
 	res->put_uint(COMPRESS_VERSION,NBITS_COMPRESS_VERSION,"COMPRESS_VERSION");
 	res->put_uint(CMPRTYPE_BADCOMPRESS,NBITS_CMPRTYPE,"CMPRTYPE");
 
-	res->put_zone((byte *)pg,pgsz*8,"INITIALBUFFER");
+	res->put_zone((byte_t *)pg,pgsz*8,"INITIALBUFFER");
     }
 
     if(verbose)
@@ -761,7 +761,7 @@
 	printf("compare failed in some unknown place in header:\n");
 	for(i=0;i<(int)(sizeof(PAGE)-sizeof(db_indx_t));i++)
 	{
-	    printf("%3d: %3x %3x\n",i,((byte *)pg)[i],((byte *)other.pg)[i]);
+	    printf("%3d: %3x %3x\n",i,((byte_t *)pg)[i],((byte_t *)other.pg)[i]);
 	}
     }
 
@@ -998,7 +998,7 @@
 	  printf("%5d: ",nn);
 	  for(j=0;j<20;j++)
 	  {
-	      printf("%2x ",((byte *)pg)[nn++]);
+	      printf("%2x ",((byte_t *)pg)[nn++]);
 	      if(nn>=pgsz){break;}
 	  }
 	  printf("\n");
Index: b/htword/WordDBPage.h
===================================================================
--- a/htword/WordDBPage.h
+++ b/htword/WordDBPage.h
@@ -65,7 +65,7 @@
 	}
     }
     WordDBRecord():WordRecord(){;}
-    WordDBRecord(byte *dat,int len,int rectyp):WordRecord()
+    WordDBRecord(byte_t *dat,int len,int rectyp):WordRecord()
     {
 	type=(rectyp ? DefaultType() : WORD_RECORD_STATS);
 	Unpack(String((char *)dat,len));
@@ -118,7 +118,7 @@
 	}
 	else{Unpack(String((char *)nkey->data,nkey->len));}
     }
-    WordDBKey(byte *data,int len):WordKey()
+    WordDBKey(byte_t *data,int len):WordKey()
     {
 	key=NULL;
 	if(!data || !len){errr("WordDBKey::WordDBKey(data,len) !data || !len");}
@@ -207,7 +207,7 @@
     void *alloc_entry(int size)
     {
 	size=WORD_ALIGN_TO(size,4);	
-	int inp_pos=((byte *)&(pg->inp[insert_indx]))-(byte *)pg;
+	int inp_pos=((byte_t *)&(pg->inp[insert_indx]))-(byte_t *)pg;
 	insert_pos-=size;
 	if(insert_pos<=inp_pos)
 	{
@@ -216,7 +216,7 @@
 	    errr("WordDBPage::alloc_entry: PAGE OVERFLOW");
 	}
 	pg->inp[insert_indx++]=insert_pos;
-	return((void *)((byte *)pg+insert_pos));
+	return((void *)((byte_t *)pg+insert_pos));
     }
 
     
@@ -260,11 +260,11 @@
 	    ky.Pack(pkey);
 	    keylen=pkey.length();
 	}
-	int size=keylen+((byte *)&(bti.data))-((byte *)&bti);// pos of data field in BINTERNAL
+	int size=keylen+((byte_t *)&(bti.data))-((byte_t *)&bti);// pos of data field in BINTERNAL
 	if(empty)
 	{
 	    if(verbose){printf("WordDBPage::insert_btikey: empty : BINTERNAL:%d datapos:%d keylen:%d size:%d alligned to:%d\n",(int)sizeof(BINTERNAL),
-			       (int)(((byte *)&(bti.data))-((byte *)&bti)),
+			       (int)(((byte_t *)&(bti.data))-((byte_t *)&bti)),
 			       keylen,size,WORD_ALIGN_TO(size,4));}
 	}
 
@@ -306,8 +306,8 @@
     int  Uncompress_main(Compressor *pin);
     void Uncompress_vals_chaged_flags(Compressor &in,unsigned int **pcflags,int *pn);
     int  Uncompress_header(Compressor &in);
-    void Uncompress_rebuild(unsigned int **rnums,int *rnum_sizes,int nnums,byte *rworddiffs,int nrworddiffs);
-    void Uncompress_show_rebuild(unsigned int **rnums,int *rnum_sizes,int nnums,byte *rworddiffs,int nrworddiffs);
+    void Uncompress_rebuild(unsigned int **rnums,int *rnum_sizes,int nnums,byte_t *rworddiffs,int nrworddiffs);
+    void Uncompress_show_rebuild(unsigned int **rnums,int *rnum_sizes,int nnums,byte_t *rworddiffs,int nrworddiffs);
 
     int TestCompress(int debuglevel);
     int Compare(WordDBPage &other);
@@ -326,14 +326,14 @@
 	    out.put_uint(btikey(i)->type ,sizeof(btikey(i)->type )*8,label_str("seperatekey_bti_type" ,i));
 	    out.put_uint(btikey(i)->pgno ,sizeof(btikey(i)->pgno )*8,label_str("seperatekey_bti_pgno" ,i));
 	    out.put_uint(btikey(i)->nrecs,sizeof(btikey(i)->nrecs)*8,label_str("seperatekey_bti_nrecs",i));
-	    if(len){out.put_zone((byte *)btikey(i)->data,8*len,label_str("seperatekey_btidata",i));}
+	    if(len){out.put_zone((byte_t *)btikey(i)->data,8*len,label_str("seperatekey_btidata",i));}
 	}
 	else
 	{
 	    int len=key(i)->len;
 	    out.put_uint(len,NBITS_KEYLEN,label_str("seperatekey_len",i));
 	    if(verbose){printf("WordDBPage::compress_key: compress(typ5):%d\n",len);}
-	    out.put_zone((byte *)key(i)->data,8*len,label_str("seperatekey_data",i));
+	    out.put_zone((byte_t *)key(i)->data,8*len,label_str("seperatekey_data",i));
 	}
     }
     void compress_data(Compressor &out,int i)
@@ -341,7 +341,7 @@
 	int len=data(i)->len;
 	out.put_uint(len,NBITS_DATALEN,label_str("seperatedata_len",i));
 	if(verbose){printf("WordDBPage::compress_data: compressdata(typ5):%d\n",len);}
-	out.put_zone((byte *)data(i)->data,8*len,label_str("seperatedata_data",i));
+	out.put_zone((byte_t *)data(i)->data,8*len,label_str("seperatedata_data",i));
     }
     WordDBKey uncompress_key(Compressor &in,int i)
     {
@@ -360,7 +360,7 @@
 	    if(len!=bti.len){errr("WordDBPage::uncompress_key: incoherence: len!=bti.len");}
 	    if(len)
 	    {
-		byte *gotdata=new byte[len];
+		byte_t *gotdata=new byte_t[len];
 		CHECK_MEM(gotdata);
 		in.get_zone(gotdata,8*len,label_str("seperatekey_btidata",i));
 		res=WordDBKey(gotdata,len);
@@ -370,7 +370,7 @@
 	}
 	else
 	{
-	    byte *gotdata=new byte[len];
+	    byte_t *gotdata=new byte_t[len];
 	    CHECK_MEM(gotdata);
 	    in.get_zone(gotdata,8*len,label_str("seperatekey_data",i));
 	    res=WordDBKey(gotdata,len);
@@ -384,7 +384,7 @@
 	WordDBRecord res;
 	int len=in.get_uint(NBITS_DATALEN,label_str("seperatedata_len",i));
 	if(verbose)printf("uncompressdata:len:%d\n",len);
-	byte *gotdata=new byte[len];
+	byte_t *gotdata=new byte_t[len];
 	CHECK_MEM(gotdata);
 	in.get_zone(gotdata,8*len,label_str("seperatedata_data",i));
 	res=WordDBRecord(gotdata,len,rectyp);
@@ -488,7 +488,7 @@
     {
 	init0();
 	pgsz=npgsz;
-	pg=(PAGE *)(new byte[pgsz]);
+	pg=(PAGE *)(new byte_t[pgsz]);
 	CHECK_MEM(pg);
 	insert_pos=pgsz;
 	insert_indx=0;