X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=ckuus5.c;h=c4c8782c9a01d45eb0504bd86fa7004c58a78fbb;hb=7cb2740ab75d86ce8de2dde75888d225d7946ca9;hp=c93036fbf4f3368e5d0f48cd503bf9782ac0f332;hpb=31e271107096d1ffa97b7d0c15222b8bd5e69f74;p=ckermit.git diff --git a/ckuus5.c b/ckuus5.c index c93036f..c4c8782 100644 --- a/ckuus5.c +++ b/ckuus5.c @@ -8723,13 +8723,13 @@ boundspair(s,sep,lo,hi,zz) char *s, *sep, *zz; int *lo, *hi; r = NULL; for (p = s; *p; p++) { /* Get the two elements */ if (*p == '[') { - bc++; + bc++; /* Bracket counter */ if (bc == 1 && !q) q = p+1; } else if (*p == ']') { bc--; if (bc == 0 && q) *p = NUL; - } else if (bc == 1) { /* Check for separator */ - s2 = ckstrchr(sep,*p); + } else if (bc == 1) { /* If within brackers */ + s2 = ckstrchr(sep,*p); /* Check for separator */ if (s2) { debug(F000,"boundspair *s2","",*s2); if (c) { @@ -8737,7 +8737,7 @@ boundspair(s,sep,lo,hi,zz) char *s, *sep, *zz; int *lo, *hi; makestr(&tmp,NULL); return(-1); } - c = *s2; + c = *s2; /* Separator character */ *p = NUL; r = p+1; } @@ -8754,8 +8754,10 @@ boundspair(s,sep,lo,hi,zz) char *s, *sep, *zz; int *lo, *hi; makestr(&tmp,NULL); return(-1); } + if (!q) q = ""; if (!*q) q = "-1"; - if (!r) r = "-1"; + if (!r) r = ""; + if (!*r) r = "-1"; e[0] = q; e[1] = r; @@ -10768,6 +10770,15 @@ initoptlist() { #ifdef __FreeBSD__ makestr(&(optlist[noptlist++]),"__FreeBSD__"); #endif /* __FreeBSD__ */ +#ifdef FREEBSD4 + makestr(&(optlist[noptlist++]),"FREEBSD4"); +#endif /* FREEBSD4 */ +#ifdef FREEBSD8 + makestr(&(optlist[noptlist++]),"FREEBSD8"); +#endif /* FREEBSD8 */ +#ifdef FREEBSD9 + makestr(&(optlist[noptlist++]),"FREEBSD9"); +#endif /* FREEBSD9 */ #ifdef __linux__ makestr(&(optlist[noptlist++]),"__linux__"); #endif /* __linux__ */ @@ -11963,6 +11974,21 @@ shofea() { flag = 1; #endif /* CK_XYZ */ +#ifdef NOFLOAT + printf(" No floating-point arithmetic\n"); + if (++lines > cmd_rows - 3) { if (!askmore()) return(1); else lines = 0; } + flag = 1; + printf(" No S-Expressions (LISP interpreter)\n"); + if (++lines > cmd_rows - 3) { if (!askmore()) return(1); else lines = 0; } + flag = 1; +#else +#ifdef NOSEXP + printf(" No S-Expressions (LISP interpreter)\n"); + if (++lines > cmd_rows - 3) { if (!askmore()) return(1); else lines = 0; } + flag = 1; +#endif /* NOSEXP */ +#endif /* NOFLOAT */ + #ifdef NOTLOG printf(" No transaction log\n"); if (++lines > cmd_rows - 3) { if (!askmore()) return(1); else lines = 0; } @@ -12332,44 +12358,59 @@ shofea() { " endian", NULL ); - if (!prtopt(&lines,line)) return(0); - if (!prtopt(&lines,"")) return(0); /* Start a new section */ - sprintf(line,"sizeofs: int=%d",sizeof(int)); /* SAFE */ - if (!prtopt(&lines,line)) return(0); - sprintf(line,"long=%d",sizeof(long)); /* SAFE */ - if (!prtopt(&lines,line)) return(0); + { +/* Whether to use %d or %ld with sizeof is a portability issue, so... */ + int size = 0; -#ifdef COMMENT -#ifdef CK_LONGLONG - sprintf(line,"long long=%d",sizeof(long long)); /* SAFE */ - if (!prtopt(&lines,line)) return(0); -#endif /* CK_LONGLONG */ -#endif /* COMMENT */ + if (!prtopt(&lines,line)) return(0); + if (!prtopt(&lines,"")) return(0); /* Start a new section */ + + size = (int)sizeof(int); + sprintf(line,"sizeofs: int=%d",size); /* SAFE */ + if (!prtopt(&lines,line)) return(0); + + size = (int)sizeof(long); + sprintf(line,"long=%d",size); /* SAFE */ + if (!prtopt(&lines,line)) return(0); #ifndef OS2 - /* Windows doesn't have off_t */ - sprintf(line,"off_t=%d",sizeof(off_t)); /* SAFE */ - if (!prtopt(&lines,line)) return(0); + /* Windows doesn't have off_t */ + size = (int)sizeof(off_t); + sprintf(line,"off_t=%d",size); /* SAFE */ + if (!prtopt(&lines,line)) return(0); #endif /* OS2 */ - sprintf(line,"CK_OFF_T=%d",sizeof(CK_OFF_T)); /* SAFE */ - if (!prtopt(&lines,line)) return(0); + size = (int)sizeof(CK_OFF_T); + sprintf(line,"CK_OFF_T=%d",size); /* SAFE */ + if (!prtopt(&lines,line)) return(0); #ifdef BIGBUFOK - sprintf(line,"size_t=%d",sizeof(size_t)); /* SAFE */ - if (!prtopt(&lines,line)) return(0); + size = (int)sizeof(size_t); + sprintf(line,"size_t=%d",size); /* SAFE */ + if (!prtopt(&lines,line)) return(0); #endif /* BIGBUFOK */ - sprintf(line,"short=%d",sizeof(short)); /* SAFE */ - if (!prtopt(&lines,line)) return(0); - sprintf(line,"char=%d",sizeof(char)); /* SAFE */ - if (!prtopt(&lines,line)) return(0); - sprintf(line,"char*=%d",sizeof(char *)); /* SAFE */ - if (!prtopt(&lines,line)) return(0); - sprintf(line,"float=%d",sizeof(float)); /* SAFE */ - if (!prtopt(&lines,line)) return(0); - sprintf(line,"double=%d",sizeof(double)); /* SAFE */ - if (!prtopt(&lines,line)) return(0); + size = (int)sizeof(short); + sprintf(line,"short=%d",size); /* SAFE */ + if (!prtopt(&lines,line)) return(0); + + size = (int)sizeof(char); + sprintf(line,"char=%d",size); /* SAFE */ + if (!prtopt(&lines,line)) return(0); + + size = (int)sizeof(char *); + sprintf(line,"char*=%d",size); /* SAFE */ + if (!prtopt(&lines,line)) return(0); + + size = (int)sizeof(float); + sprintf(line,"float=%d",size); /* SAFE */ + if (!prtopt(&lines,line)) return(0); + + size = (int)sizeof(double); + sprintf(line,"double=%d",size); /* SAFE */ + if (!prtopt(&lines,line)) return(0); + } + #ifdef FNFLOAT if (!prtopt(&lines,"")) return(0); /* Start a new section */ if (!prtopt(&lines,"floating-point:")) return(0);