Mercurial > libavutil.hg
comparison tree.c @ 726:5d344280a1f8 libavutil
cosmetics: Rename prn variable to prng (Pseudo Random Number Generator).
author | diego |
---|---|
date | Fri, 10 Apr 2009 17:23:38 +0000 |
parents | 01f68e5fb9af |
children | f0e08dd7d583 |
comparison
equal
deleted
inserted
replaced
725:d199c3b8cbd3 | 726:5d344280a1f8 |
---|---|
180 | 180 |
181 int main(void){ | 181 int main(void){ |
182 int i; | 182 int i; |
183 void *k; | 183 void *k; |
184 AVTreeNode *root= NULL, *node=NULL; | 184 AVTreeNode *root= NULL, *node=NULL; |
185 AVLFG prn; | 185 AVLFG prng; |
186 | 186 |
187 av_lfg_init(&prn, 1); | 187 av_lfg_init(&prng, 1); |
188 | 188 |
189 for(i=0; i<10000; i++){ | 189 for(i=0; i<10000; i++){ |
190 int j = av_lfg_get(&prn) % 86294; | 190 int j = av_lfg_get(&prng) % 86294; |
191 if(check(root) > 999){ | 191 if(check(root) > 999){ |
192 av_log(NULL, AV_LOG_ERROR, "FATAL error %d\n", i); | 192 av_log(NULL, AV_LOG_ERROR, "FATAL error %d\n", i); |
193 print(root, 0); | 193 print(root, 0); |
194 return -1; | 194 return -1; |
195 } | 195 } |
196 av_log(NULL, AV_LOG_ERROR, "inserting %4d\n", j); | 196 av_log(NULL, AV_LOG_ERROR, "inserting %4d\n", j); |
197 if(!node) | 197 if(!node) |
198 node= av_mallocz(av_tree_node_size); | 198 node= av_mallocz(av_tree_node_size); |
199 av_tree_insert(&root, (void*)(j+1), cmp, &node); | 199 av_tree_insert(&root, (void*)(j+1), cmp, &node); |
200 | 200 |
201 j = av_lfg_get(&prn) % 86294; | 201 j = av_lfg_get(&prng) % 86294; |
202 { | 202 { |
203 AVTreeNode *node2=NULL; | 203 AVTreeNode *node2=NULL; |
204 av_log(NULL, AV_LOG_ERROR, "removing %4d\n", j); | 204 av_log(NULL, AV_LOG_ERROR, "removing %4d\n", j); |
205 av_tree_insert(&root, (void*)(j+1), cmp, &node2); | 205 av_tree_insert(&root, (void*)(j+1), cmp, &node2); |
206 k= av_tree_find(root, (void*)(j+1), cmp, NULL); | 206 k= av_tree_find(root, (void*)(j+1), cmp, NULL); |