From b75f75e80ea1130b3d3f21d5c0da1789ce988d1c Mon Sep 17 00:00:00 2001 From: dos-reis Date: Sun, 8 Mar 2015 18:54:04 +0000 Subject: Fix misc warnings. --- src/etc/asq.c.pamphlet | 56 +++++++++++++++++++++++++------------------------- src/hyper/hthits.c | 4 ++-- src/lib/cfuns-c.c | 3 +-- src/lib/edin.c | 2 +- src/sman/session.c | 2 +- 5 files changed, 33 insertions(+), 34 deletions(-) diff --git a/src/etc/asq.c.pamphlet b/src/etc/asq.c.pamphlet index f5c0c8b1..44771f36 100644 --- a/src/etc/asq.c.pamphlet +++ b/src/etc/asq.c.pamphlet @@ -1356,7 +1356,7 @@ int pprintcond(int seekpt,char *path); return(0); } -/*defun*/ int pprintinfo(char *property) +/*defun*/ int pprintinfo(const char* property) /* prettyprint the information from the database files */ { int pretty = 1; /* print pretty form for any option */ int all = 0; /* only print the option specificed */ @@ -1402,37 +1402,37 @@ int pprintcond(int seekpt,char *path); return(0); } -/*defun*/ char *fullname(char *property, char *progname) +/*defun*/ const char* fullname(char *property, char *progname) /* expand an abbreviation to the full name */ -{ if (strncmp(property,"ab",2) == 0) return("abbreviation"); - else if (strncmp(property,"al",2) == 0) return("all"); - else if (strncmp(property,"an",2) == 0) return("ancestors"); - else if (strncmp(property,"at",2) == 0) return("attributes"); - else if (strncmp(property,"ca",2) == 0) return("constructorcategory"); - else if (strncmp(property,"cc",2) == 0) return("constructorcategory"); - else if (strncmp(property,"cf",2) == 0) return("constructorform"); - else if (strncmp(property,"fo",2) == 0) return("constructorform"); - else if (strncmp(property,"ck",2) == 0) return("constructorkind"); - else if (strncmp(property,"ki",2) == 0) return("constructorkind"); - else if (strncmp(property,"cm",2) == 0) return("constructormodemap"); - else if (strncmp(property,"con",3) == 0) return("constructor"); - else if (strncmp(property,"cos",3) == 0) return("cosig"); - else if (strncmp(property,"de",2) == 0) return("defaultdomain"); - else if (strncmp(property,"dom",3) == 0) return("domain"); - else if (strncmp(property,"doc",3) == 0) return("documentation"); - else if (strncmp(property,"mo",2) == 0) return("modemaps"); - else if (strncmp(property,"ni",2) == 0) return("niladic"); - else if (strncmp(property,"ob",2) == 0) return("object"); - else if (strncmp(property,"op",2) == 0) return("operationalist"); - else if (strncmp(property,"pr",2) == 0) return("predicates"); - else if (strncmp(property,"sh",2) == 0) return("short"); +{ if (strncmp(property,"ab",2) == 0) return "abbreviation"; + else if (strncmp(property,"al",2) == 0) return "all"; + else if (strncmp(property,"an",2) == 0) return "ancestors"; + else if (strncmp(property,"at",2) == 0) return "attributes"; + else if (strncmp(property,"ca",2) == 0) return "constructorcategory"; + else if (strncmp(property,"cc",2) == 0) return "constructorcategory"; + else if (strncmp(property,"cf",2) == 0) return "constructorform"; + else if (strncmp(property,"fo",2) == 0) return "constructorform"; + else if (strncmp(property,"ck",2) == 0) return "constructorkind"; + else if (strncmp(property,"ki",2) == 0) return "constructorkind"; + else if (strncmp(property,"cm",2) == 0) return "constructormodemap"; + else if (strncmp(property,"con",3) == 0) return "constructor"; + else if (strncmp(property,"cos",3) == 0) return "cosig"; + else if (strncmp(property,"de",2) == 0) return "defaultdomain"; + else if (strncmp(property,"dom",3) == 0) return "domain"; + else if (strncmp(property,"doc",3) == 0) return "documentation"; + else if (strncmp(property,"mo",2) == 0) return "modemaps"; + else if (strncmp(property,"ni",2) == 0) return "niladic"; + else if (strncmp(property,"ob",2) == 0) return "object"; + else if (strncmp(property,"op",2) == 0) return "operationalist"; + else if (strncmp(property,"pr",2) == 0) return "predicates"; + else if (strncmp(property,"sh",2) == 0) return "short"; else if (strncmp(property,"so",2) == 0) return("sourcefile"); printf("I don't know what %s means. I'll use 'short'\n",property); printf("type %s with no arguments to get the usage page\n",progname); - return("short"); + return "short"; } -/*defun*/ int printhelp(char *arg) +/*defun*/ int printhelp(const char* arg) {printf("%s -property searchkey \n\n",arg); printf("property is one of the following flags: \n"); printf(" (al) all (default) (sh) short\n"); @@ -1455,8 +1455,8 @@ int pprintcond(int seekpt,char *path); /*defun*/ int main(int argc, char *argv[]) { /* FILE *test; when testing we leave tombstones */ - const char *ssearch =""; /* the domain or abbreviation */ - char *property=""; /* the property we want (e.g. niladic) */ + const char* ssearch =""; /* the domain or abbreviation */ + const char* property=""; /* the property we want (e.g. niladic) */ int found=1; /* did we find the domain? print if yes */ char c; /* a temporary */ int i; /* a temporary */ diff --git a/src/hyper/hthits.c b/src/hyper/hthits.c index 0dd712c5..ce277e65 100644 --- a/src/hyper/hthits.c +++ b/src/hyper/hthits.c @@ -98,7 +98,7 @@ badDB(void) static void untexbuf(register char* s) { - register char *d = s; + char *d = s; while (*s) switch (*s) { @@ -176,7 +176,7 @@ splitpage(char* buf, char** ptitle, char** pbody) static void squirt(char* s, int n) { - register char *t, *e; + char *t, *e; int c; c = s[n]; diff --git a/src/lib/cfuns-c.c b/src/lib/cfuns-c.c index 856e4bcc..11c28691 100644 --- a/src/lib/cfuns-c.c +++ b/src/lib/cfuns-c.c @@ -873,8 +873,7 @@ oa_substr(const char* str, const size_t begin, const size_t end) int len; if (str == NULL || strlen(str) == 0 || - strlen(str) < begin || end >= strlen(str) || - begin > end || begin < 0 || end < 0) + strlen(str) < begin || end >= strlen(str) || begin > end) return NULL; len = (end - begin) + 2; diff --git a/src/lib/edin.c b/src/lib/edin.c index c93e2876..f85a632a 100644 --- a/src/lib/edin.c +++ b/src/lib/edin.c @@ -158,7 +158,7 @@ do_reading(void) if (ttt_read > 0) num_read = num_read + ttt_read; } - if ((in_buff[num_proc + 1] == _LBRACK)) { + if (in_buff[num_proc + 1] == _LBRACK) { /* ESC [ */ diff --git a/src/sman/session.c b/src/sman/session.c index 6c3746d2..e7edf001 100644 --- a/src/sman/session.c +++ b/src/sman/session.c @@ -253,7 +253,7 @@ fprintf(stderr,"menu:SwitchFrames\n"); send_int(spad_server, SwitchFrames); send_int(spad_server, frame); for(i=0,pSock=plSock; pSock != (Sock_List *) 0 ; i++,pSock=pSock->next) - if ((pSock->Socket.frame == frame)) { + if (pSock->Socket.frame == frame) { active_session = (openaxiom_sio *)pSock; reading_output = 1; break; -- cgit v1.2.3