Talk:C: Difference between revisions

636 bytes added ,  1 year ago
latest pe.c
(Added early PE)
(latest pe.c)
 
Line 1:
 
===pe.c===
<nowiki>
 
 
#if 1
#else
#error NEXT= ??? 16! = c.20x10^40
#endif
 
/* TODO: PrecPup dev (gcc) */
/* https://www.onlinegdb.com/online_c_compiler */
 
#include <stdio.h>
Line 30 ⟶ 40:
};
 
/*
struct l_; typedef struct l_ l_; struct l_ {
n_ *h;
}; /**/
 
typedef int rand_f(void);
/* static rand_f *rf= rand; /**/
 
static void dump(n_ *p);
 
/*\ \*/ /*\ \*/ /*\ \*/
Line 48 ⟶ 61:
if (r->x < y) {
*lo= r; lo= &r->n;
t+= r->p + 1;
} else {
*hi= r; hi= &r->n;
r->p+= t;
/* t= 0; /**/
}
}
Line 62 ⟶ 75:
/*\ \*/ /*\ \*/ /*\ \*/
 
static void recurse_(lnat it, n_**hd) {
 
assert(*hd);
printf("it= %lu\n", it);
{ lnat x= (*hd)->x, p= (*hd)->p;
printf("it= %lu, r= (%lu, %lu, %lu)\t", it, x, p, x-p);
assert(x>=p);
}
dump(*hd);
fflush(0);
}
Line 70 ⟶ 88:
/*\ \*/
 
static void recurse(lnat lo, lnat hi, n_ **hd) {
lnat mi;
/**/
printf("lo\tlo= %lu hi= %lu\nt", lo, hi);
dump(*hd);
fflush(0); /**/
 
assert(lo<=hi);
if (lo!=hi); else { recurse_(lo, hd); return; }
 
 
mi= 2+hi-lo; mi= mi/2+lo;
 
{ n_ *li[1];
recurse(lo, mi-1);
/**/ printfsplit("lo= %luhd, hi= %lu\n"li, lo0, himi); /**/
 
recurse(mi, hi);
recurse(lo, mi-1, hd);
printf("lo= %lu mi= %lu hi= %lu\n", lo, mi, hi);
recurse(mi, hi, li);
}
}
 
Line 107 ⟶ 129:
assert(p<a__[1]);
d= p-*a__;
printf(d>>4? "^": "%X(x%lu..=%lu)->", (unsigned)d&15u, p->p, p->x);
if (d>>5); else {
d= 1ul<<d;
Line 128 ⟶ 150:
assert(hd); assert(a);
 
for (i= K+10; --i >= 0; ) { (--q)->n= p; p= q; p->p= 0; p->x= i; }
 
*hd= p;
Line 199 ⟶ 221:
assert(*hd);
dump(*hd);
printf("[[ at %u]]\n", __LINE__);
 
*hd= 0;
Line 205 ⟶ 227:
assert(*hd);
dump(*hd);
printf("[[ at %u]]\n", __LINE__);
 
/* return *hd; /**/
 
*hd= 0;
Line 213 ⟶ 233:
assert(*hd);
dump(*hd);
printf("[[ at %u]]\n", __LINE__);
 
*hd= 0;
Line 219 ⟶ 239:
assert(*hd);
dump(*hd);
printf("[[ at %u]]\n", __LINE__);
 
/**/ return *hd; /**/
 
*hd= 0;
Line 225 ⟶ 247:
assert(*hd);
dump(*hd);
printf("[[ at %u]]\n", __LINE__);
 
/*
*hd= 0;
tests_R1(hd, a__);
assert(*hd);
dump(*hd);
printf("it=[[ at %luu]]\n", it__LINE__);
/**/
 
return *hd;
Line 233 ⟶ 263:
 
static int dtj(void) {
n_ *hd[1];
 
/* recurse(0, K-1); /**/
/* (die)(0); /**/
(void)*hd= tests();
/* dump(tests()0); /**/
dump(*hd); /**/
/* recurse(0, K-1, hd); /**/
 
return 0;
Line 278 ⟶ 310:
(void)ac; (void)av;
 
ac= dothejob(); /**/
return ac;
}
 
#if 1
#else
#error NEXT FILE
 
Line 334 ⟶ 368:
return EXIT_SUCCESS;
}
 
#endif
 
 
</nowiki>
3

edits