comparison src/xdiff/xhistogram.c @ 18802:3be01cf0a632 v8.1.2389

patch 8.1.2389: using old C style comments Commit: https://github.com/vim/vim/commit/707d226ac58da752ecc6b7620055fb1df3957a27 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Dec 4 22:16:54 2019 +0100 patch 8.1.2389: using old C style comments Problem: Using old C style comments. Solution: Use // comments where appropriate.
author Bram Moolenaar <Bram@vim.org>
date Wed, 04 Dec 2019 22:30:07 +0100
parents 195e8b1fcbbf
children d5142d87f898
comparison
equal deleted inserted replaced
18801:484c63777038 18802:3be01cf0a632
53 53
54 struct histindex { 54 struct histindex {
55 struct record { 55 struct record {
56 unsigned int ptr, cnt; 56 unsigned int ptr, cnt;
57 struct record *next; 57 struct record *next;
58 } **records, /* an occurrence */ 58 } **records, // an occurrence
59 **line_map; /* map of line to record chain */ 59 **line_map; // map of line to record chain
60 chastore_t rcha; 60 chastore_t rcha;
61 unsigned int *next_ptrs; 61 unsigned int *next_ptrs;
62 unsigned int table_bits, 62 unsigned int table_bits,
63 records_size, 63 records_size,
64 line_map_size; 64 line_map_size;
126 * it onto the front of the existing element 126 * it onto the front of the existing element
127 * chain. 127 * chain.
128 */ 128 */
129 NEXT_PTR(index, ptr) = rec->ptr; 129 NEXT_PTR(index, ptr) = rec->ptr;
130 rec->ptr = ptr; 130 rec->ptr = ptr;
131 /* cap rec->cnt at MAX_CNT */ 131 // cap rec->cnt at MAX_CNT
132 rec->cnt = XDL_MIN(MAX_CNT, rec->cnt + 1); 132 rec->cnt = XDL_MIN(MAX_CNT, rec->cnt + 1);
133 LINE_MAP(index, ptr) = rec; 133 LINE_MAP(index, ptr) = rec;
134 goto continue_scan; 134 goto continue_scan;
135 } 135 }
136 136
152 rec->next = *rec_chain; 152 rec->next = *rec_chain;
153 *rec_chain = rec; 153 *rec_chain = rec;
154 LINE_MAP(index, ptr) = rec; 154 LINE_MAP(index, ptr) = rec;
155 155
156 continue_scan: 156 continue_scan:
157 ; /* no op */ 157 ; // no op
158 } 158 }
159 159
160 return 0; 160 return 0;
161 } 161 }
162 162
264 index.env = env; 264 index.env = env;
265 index.xpp = xpp; 265 index.xpp = xpp;
266 266
267 index.records = NULL; 267 index.records = NULL;
268 index.line_map = NULL; 268 index.line_map = NULL;
269 /* in case of early xdl_cha_free() */ 269 // in case of early xdl_cha_free()
270 index.rcha.head = NULL; 270 index.rcha.head = NULL;
271 271
272 index.table_bits = xdl_hashbits(count1); 272 index.table_bits = xdl_hashbits(count1);
273 sz = index.records_size = 1 << index.table_bits; 273 sz = index.records_size = 1 << index.table_bits;
274 sz *= sizeof(struct record *); 274 sz *= sizeof(struct record *);
286 sz *= sizeof(unsigned int); 286 sz *= sizeof(unsigned int);
287 if (!(index.next_ptrs = (unsigned int *) xdl_malloc(sz))) 287 if (!(index.next_ptrs = (unsigned int *) xdl_malloc(sz)))
288 goto cleanup; 288 goto cleanup;
289 memset(index.next_ptrs, 0, sz); 289 memset(index.next_ptrs, 0, sz);
290 290
291 /* lines / 4 + 1 comes from xprepare.c:xdl_prepare_ctx() */ 291 // lines / 4 + 1 comes from xprepare.c:xdl_prepare_ctx()
292 if (xdl_cha_init(&index.rcha, sizeof(struct record), count1 / 4 + 1) < 0) 292 if (xdl_cha_init(&index.rcha, sizeof(struct record), count1 / 4 + 1) < 0)
293 goto cleanup; 293 goto cleanup;
294 294
295 index.ptr_shift = line1; 295 index.ptr_shift = line1;
296 index.max_chain_length = 64; 296 index.max_chain_length = 64;