diff options
author | Garrett Cooper <yanegomi@gmail.com> | 2010-12-19 09:58:10 -0800 |
---|---|---|
committer | Garrett Cooper <yanegomi@gmail.com> | 2010-12-19 09:58:10 -0800 |
commit | 1e6f5a673655551de5734ff31ef48cd63b604e6d (patch) | |
tree | a8faf04ed2df6da929c9db820c22c53a81c6153a /pan | |
parent | 40d9ee225d8080f03d4f3380fa355a5f9a322f2f (diff) |
Resolving all compile errors via a script
This may leave dupe calls to tst_exit in main, but those are easier
to deal (and much less) than no-compile scenarios.
As a side-effect, fix all trailing whitespace issues.
Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
Diffstat (limited to 'pan')
-rw-r--r-- | pan/debug.c | 6 | ||||
-rw-r--r-- | pan/ltp-bump.c | 2 | ||||
-rw-r--r-- | pan/ltp-pan.c | 55 | ||||
-rw-r--r-- | pan/ltp-scanner.c | 10 | ||||
-rw-r--r-- | pan/reporter.c | 12 | ||||
-rw-r--r-- | pan/splitstr.c | 2 | ||||
-rw-r--r-- | pan/symbol.c | 24 | ||||
-rw-r--r-- | pan/tag_report.c | 36 | ||||
-rw-r--r-- | pan/zoolib.c | 66 |
9 files changed, 106 insertions, 107 deletions
diff --git a/pan/debug.c b/pan/debug.c index d67c46f60..5eb7e3288 100644 --- a/pan/debug.c +++ b/pan/debug.c @@ -63,7 +63,7 @@ set_debug(char *optarg) db_area=atoi(d_area); if (db_area > MAXDEBUG) { - printf("Error - Debug area %s > maximum of %d\n", d_area, + printf("Error - Debug area %s > maximum of %d\n", d_area, MAXDEBUG); exit(-1); } @@ -74,7 +74,7 @@ set_debug(char *optarg) Debug[db_area] = db_level; if ((d_area = strchr(d_area, ',')) != NULL) d_area++; - } + } if ((d_area = strchr(d_level, ',')) == NULL) break; } @@ -83,4 +83,4 @@ set_debug(char *optarg) #endif return 0; -} +}
\ No newline at end of file diff --git a/pan/ltp-bump.c b/pan/ltp-bump.c index 29d3480b0..e65fb3ff8 100644 --- a/pan/ltp-bump.c +++ b/pan/ltp-bump.c @@ -108,4 +108,4 @@ int main(int argc, char **argv) zoo_close(zoo); exit(0); -} +}
\ No newline at end of file diff --git a/pan/ltp-pan.c b/pan/ltp-pan.c index c894de701..886e74d23 100644 --- a/pan/ltp-pan.c +++ b/pan/ltp-pan.c @@ -30,10 +30,10 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * * Changelog: - * + * * Added timer options: William Jay Huie, IBM * 01/27/03 - Added: Manoj Iyer, manjo@mail.utexas.edu - * - option '-p' (pretty printing)i to enabled formatted printing + * - option '-p' (pretty printing)i to enabled formatted printing * of results. * * 01/27/03 - Added: Manoj Iyer, manjo@mail.utexas.edu @@ -47,7 +47,7 @@ * * 07/22/07 - Added: Ricardo Salveti de Araujo, rsalveti@linux.vnet.ibm.com * - added option to create a command file with all failed tests. - * + * */ /* $Id: ltp-pan.c,v 1.4 2009/10/15 18:45:55 yaberauneya Exp $ */ @@ -103,7 +103,7 @@ static struct collection *get_collection(char *file, int optind, int argc, char **argv); static void pids_running(struct tag_pgrp *running, int keep_active); static int check_pids(struct tag_pgrp *running, int *num_active, - int keep_active, FILE * logfile, FILE * failcmdfile, + int keep_active, FILE * logfile, FILE * failcmdfile, struct orphan_pgrp *orphans, int fmt_print, int *failcnt, int quiet_mode); static void propagate_signal(struct tag_pgrp *running, int keep_active, @@ -246,11 +246,11 @@ main(int argc, char **argv) { switch (modifier) { - case 's': run_time = run_time; break; - case 'm': run_time = run_time * 60; break; - case 'h': run_time = run_time * 60 * 60; break; + case 's': run_time = run_time; break; + case 'm': run_time = run_time * 60; break; + case 'h': run_time = run_time * 60 * 60; break; case 'd': run_time = run_time * 60 * 60 * 24; break; - default: + default: fprintf(stderr, "Invalid time modifier, try: s|h|m|d\n"); exit(-1); } if (!quiet_mode) @@ -315,7 +315,7 @@ main(int argc, char **argv) { fprintf(logfile, "Test Start Time: %s\n", s); fprintf(logfile, "-----------------------------------------\n"); - fprintf(logfile, "%-30.20s %-10.10s %-10.10s\n", + fprintf(logfile, "%-30.20s %-10.10s %-10.10s\n", "Testcase", "Result", "Exit Value"); fprintf(logfile, "%-30.20s %-10.10s %-10.10s\n", "--------", "------", "------------"); @@ -504,17 +504,17 @@ main(int argc, char **argv) } /* while ((num_active < keep_active) && (starts != 0)) */ if (starts == 0) - { + { if (!quiet_mode) - printf("incrementing stop\n"); - ++stop; + printf("incrementing stop\n"); + ++stop; } else if (starts == -1) //wjh { FILE *f = (FILE*)-1; if ((f = fopen(PAN_STOP_FILE, "r")) != 0) { printf("Got %s Stopping!\n", PAN_STOP_FILE); - fclose(f); unlink(PAN_STOP_FILE); stop++; + fclose(f); unlink(PAN_STOP_FILE); stop++; } } @@ -741,9 +741,9 @@ check_pids(struct tag_pgrp *running, int *num_active, int keep_active, (int) (tms2.tms_cstime - tms1.tms_cstime)); else { - if (w != 0) + if (w != 0) ++*failcnt; - fprintf(logfile, "%-30.30s %-10.10s %-5d\n", + fprintf(logfile, "%-30.30s %-10.10s %-5d\n", running[i].cmd->name, ((w != 0) ? "FAIL" : "PASS"), w); } @@ -828,7 +828,7 @@ run_child(struct coll_entry *colle, struct tag_pgrp *active, int quiet_mode) active->output); return -1; } - } + } /* get the tag's command line arguments ready. subst_pcnt_f() uses a * static counter, that's why we do it here instead of after we fork. @@ -838,7 +838,7 @@ run_child(struct coll_entry *colle, struct tag_pgrp *active, int quiet_mode) } else { c_cmdline = colle->cmdline; } - + if (pipe(errpipe) < 0) { fprintf(stderr, "pan(%s): pipe() failed. errno:%d %s\n", panname, errno, strerror(errno)); @@ -852,7 +852,7 @@ run_child(struct coll_entry *colle, struct tag_pgrp *active, int quiet_mode) time(&active->mystime); active->cmd = colle; - if (!test_out_dir) + if (!test_out_dir) if (!quiet_mode) write_test_start(active); @@ -912,14 +912,14 @@ run_child(struct coll_entry *colle, struct tag_pgrp *active, int quiet_mode) */ if (strpbrk(c_cmdline, "\"';|<>$\\")) { execlp("sh", "sh", "-c", c_cmdline, (char*)0); - errlen = sprintf(errbuf, + errlen = sprintf(errbuf, "pan(%s): execlp of '%s' (tag %s) failed. errno:%d %s", panname, c_cmdline, colle->name, errno, strerror(errno)); } else { char **arg_v; arg_v = (char **)splitstr(c_cmdline, NULL, NULL); - + execvp(arg_v[0], arg_v); errlen = sprintf(errbuf, "pan(%s): execvp of '%s' (tag %s) failed. errno:%d %s", @@ -935,11 +935,11 @@ run_child(struct coll_entry *colle, struct tag_pgrp *active, int quiet_mode) /* subst_pcnt_f() allocates the command line dynamically * free the malloc to prevent a memory leak */ - if (colle->pcnt_f) free(c_cmdline); + if (colle->pcnt_f) free(c_cmdline); close(errpipe[1]); - /* if the child couldn't go through with the exec, + /* if the child couldn't go through with the exec, * clean up the mess, note it, and move on */ if (read(errpipe[0], &errlen, sizeof(errlen))) { @@ -968,10 +968,10 @@ run_child(struct coll_entry *colle, struct tag_pgrp *active, int quiet_mode) termtype = "unknown"; } time(&end_time); - if (!quiet_mode) + if (!quiet_mode) { //write_test_start(active, errbuf); - write_test_end(active, errbuf, end_time, termtype, status, + write_test_end(active, errbuf, end_time, termtype, status, termid, ¬ime, ¬ime); } if (capturing) { @@ -1016,7 +1016,7 @@ subst_pcnt_f(struct coll_entry *colle) char new_cmdline[1024]; /* if we get called falsely, do the right thing anyway */ - if (!colle->pcnt_f) + if (!colle->pcnt_f) return colle->cmdline; snprintf(pid_and_counter, 20, "%d_%d", getpid(), counter++); @@ -1056,7 +1056,7 @@ get_collection(char *file, int optind, int argc, char **argv) n->name = strdup(strsep(&a, " \t")); n->cmdline = strdup(a); n->next = NULL; - + if (p) { p->next = n; } @@ -1074,7 +1074,7 @@ get_collection(char *file, int optind, int argc, char **argv) if (optind < argc) { char workstr[1024] = ""; int workstr_left = 1023; - + /* fill arg list */ for (i = 0; optind < argc; ++optind, ++i) { strncat(workstr, argv[optind], workstr_left); @@ -1314,4 +1314,3 @@ wait_handler( int sig ) lastsent = send_signal; } } - diff --git a/pan/ltp-scanner.c b/pan/ltp-scanner.c index 20177cf0f..8f80864b2 100644 --- a/pan/ltp-scanner.c +++ b/pan/ltp-scanner.c @@ -38,7 +38,7 @@ * and saves the information into an in-memory hierarchical keyword table. * * The reporting segment of the program reads that keyword table to produce - * it's reports. + * it's reports. * * Synopsis: * ltp-scanner [ -e ] [ -D area:level ] [ -h ] @@ -70,9 +70,9 @@ * multiple TCIDs. It must be the sum of all TCIDs' testcases. * * System Configuration: - * ARCHITECTURE IOS_MODEL_E CRAY_YMP YMP7XX - * CONFIG JOBCNTL AVL BMD EMA HPM SECURE TFM_UDB_6 SDS SSD - * RELEASE 82 + * ARCHITECTURE IOS_MODEL_E CRAY_YMP YMP7XX + * CONFIG JOBCNTL AVL BMD EMA HPM SECURE TFM_UDB_6 SDS SSD + * RELEASE 82 * UNAME sn1703c cool 8.2.0ae d82.25 * date 03/24/94 * @@ -171,4 +171,4 @@ int main(int argc, char *argv[]) reporter(tags); exit(0); -} +}
\ No newline at end of file diff --git a/pan/reporter.c b/pan/reporter.c index 1c970c67c..6506de542 100644 --- a/pan/reporter.c +++ b/pan/reporter.c @@ -65,11 +65,11 @@ static int (*test_end_func)( SYM, SYM, SYM ) = scanner_test_end; * the depths of the current symbol table implimentation (there are the * cursors there that I could use) so that a different (faster!) symbol * table can be used in the future. - * + * * I could get a key (tag), get it's sub-keys (TCIDs), then get the key * again to reset to the top level, _then_ get the next key. That would * be very inefficient. - * + * * The solution I chose is to extract all tags into a list (char array), * then go thru that list with the cursor free for other levels to use. * @@ -77,7 +77,7 @@ static int (*test_end_func)( SYM, SYM, SYM ) = scanner_test_end; * (2) search for the first tag that has a "stime" record, and use that as * the date (MMDDYY) that the tests were run. * (3) print the report header - * (4) go thru all tags and report each as described at the beginning of + * (4) go thru all tags and report each as described at the beginning of * this file */ static int @@ -177,7 +177,7 @@ scanner_reporter(tags) * (3) insert it into the global data under this tag, replacing any existing * data. * - * a "feature" of the key implimentation: I can insert a key tree + * a "feature" of the key implimentation: I can insert a key tree * under another key tree with almost zero brainwork because a SYM * is what the DATA area points to. */ @@ -253,7 +253,7 @@ iscanner_test_end(alltags, ctag, keys) /* insert keys into tag */ sym_put(ctag, "_keys", (void *)keys, 0); - + return tag_report(alltags, ctag, keys); } @@ -277,4 +277,4 @@ void set_iscanner(void) { reporter_func = iscanner_reporter; test_end_func = iscanner_test_end; -} +}
\ No newline at end of file diff --git a/pan/splitstr.c b/pan/splitstr.c index 14f2f000e..3c688a73a 100644 --- a/pan/splitstr.c +++ b/pan/splitstr.c @@ -194,4 +194,4 @@ int main() return 0; } -#endif +#endif
\ No newline at end of file diff --git a/pan/symbol.c b/pan/symbol.c index bdd5843c1..9b5358373 100644 --- a/pan/symbol.c +++ b/pan/symbol.c @@ -177,25 +177,25 @@ SYM sym_open(int flags, int mode, int openinfo) * element two of a three or more element key), return ENOTDIR. * * "data" is not duplicated and must not point to a static area that could - * go away before the element is deleted (such as a local string in a + * go away before the element is deleted (such as a local string in a * function) * * "key" is duplicated as needed, and is not modified. * * Code: * chop up key on commas - * + * * search until a key element isn't found in the key tree, the key list is * exhausted, or a key's data element is not a sub-tree - * + * * if the key list is exhausted, return a "duplicate entry" error - * + * * if the last found key's data element is not a sub-tree, return * something like "ENOTDIR". - * - * add new keys for sub-trees until key list is exhausted; + * + * add new keys for sub-trees until key list is exhausted; * last node gets 'data'. - * + * */ int sym_put(SYM sym, char *key, void *data, int flags) @@ -311,7 +311,7 @@ void * sym_get(SYM sym, char *key) free(nkey); return(NULL); } -} +} /* * Step thru a symbol table list @@ -325,11 +325,11 @@ int SYM csym; switch(flags) { - /* + /* * A number of ways to do this: * specificly: sym_seq( .., "key,key") sets to Nth element of the 2nd * level symbol table - * sym_seq(.., "key,key,") sets to the first element of the 3rd + * sym_seq(.., "key,key,") sets to the first element of the 3rd * level symbol table * * sym_seq(.., "key,key") where both must be complete keys, sets @@ -434,7 +434,7 @@ sym_dump_s(SYM sym, int depth) sym_dump_s((SYM)se->data, depth+1); } else { printf("(%p) = %s (%p)\n", se->key, (char *)se->data, se->data); - } + } } return 0; } @@ -469,4 +469,4 @@ sym_rm(SYM sym, int flags) if (!(flags&RM_DATA)) free(sym); return 0; -} +}
\ No newline at end of file diff --git a/pan/tag_report.c b/pan/tag_report.c index 9065f50e0..a7f57143f 100644 --- a/pan/tag_report.c +++ b/pan/tag_report.c @@ -212,11 +212,11 @@ cuts_report(tags, keys, at, tag ) * the depths of the current symbol table implimentation (there are the * cursors there that I could use) so that a different (faster!) symbol * table can be used in the future. - * + * * I could get a key (tag), get it's sub-keys (TCIDs), then get the key * again to reset to the top level, _then_ get the next key. That would * be very inefficient. - * + * * The solution I chose is to extract all tags into a list (char array), * then go thru that list with the cursor free for other levels to use. * @@ -224,66 +224,66 @@ cuts_report(tags, keys, at, tag ) * (2) search for the first tag that has a "stime" record, and use that as * the date (MMDDYY) that the tests were run. * (3) print the report header - * (4) go thru all tags and report each as described at the beginning of + * (4) go thru all tags and report each as described at the beginning of * this file */ int tag_report(alltags, ctag, keys) SYM alltags, ctag, keys; { - + extern int extended; - + char key_get[KEYSIZE]; char *info; - + /* retrieved _keys values: initation status, start time, duration, * termination type, termination id, start line, end line. */ char *tag, *contact, *is, *mystime, *duration, *tt, *ti, *sl, *el; - + /* Check all driver-level status first */ strcpy(key_get, "tag"); if ((tag = (char *)sym_get(keys, key_get)) == NULL) { return -1; } - + /* Check all driver-level status first */ strcpy(key_get, "initiation_status"); if ((is = (char *)sym_get(keys, key_get)) == NULL) { test_result(tag, NULL, NULL, "no init status", keys); return -1; } - + if (strcmp(is, "ok")) { test_result(tag, NULL, NULL, is, keys); } else { - + strcpy(key_get, "corefile"); if ((info = (char *)sym_get(keys, key_get)) != NULL) if (strcmp(info, "no") != 0) { test_result(tag, NULL, NULL, "coredump", keys); } - + strcpy(key_get, "termination_type"); if ((tt = (char *)sym_get(keys, key_get))==NULL) { test_result(tag, NULL, NULL, "no Term Type", keys); return -1; } - + if (strcmp(tt, "exited")) { test_result(tag, NULL, NULL, tt, keys); } - + strcpy(key_get, "analysis"); if ((info = (char *)sym_get(keys, key_get)) == NULL) { test_result(tag, NULL, NULL, "no Analysis Type", keys); return -1; } - + /* Getting here indicates that there were no fatal driver-level * errors. Do the kind of reporting requested by the test. */ - + if (strncmp(info, "none", 4) == 0) { /* * If analysis is 'none', alway report the test as @@ -313,7 +313,7 @@ tag_report(alltags, ctag, keys) cuts_report(ctag, keys, info, tag); } } - + /* * Extended Format: * - tcid+tc = "!" @@ -327,7 +327,7 @@ tag_report(alltags, ctag, keys) * Start Line (of test results in output file) * End Line */ - + if (extended) { strcpy(key_get, "termination_id"); @@ -485,4 +485,4 @@ worst_case(t1, t2) else return(t2); -} +}
\ No newline at end of file diff --git a/pan/zoolib.c b/pan/zoolib.c index 1685b947a..ed4efc55b 100644 --- a/pan/zoolib.c +++ b/pan/zoolib.c @@ -31,13 +31,13 @@ * */ /* $Id: zoolib.c,v 1.8 2009/06/09 17:59:46 subrata_modak Exp $ */ -/* +/* * ZooLib * * A Zoo is a file used to record what test tags are running at the moment. * If the system crashes, we should be able to look at the zoo file to find out * what was currently running. This is especially helpful when running multiple - * tests at the same time. + * tests at the same time. * * The zoo file is meant to be a text file that fits on a standard console. * You should be able to watch it with `cat zoofile` @@ -61,7 +61,7 @@ extern int sighold (int __sig); extern int sigrelse (int __sig); #endif -/* zoo_mark(): private function to make an entry to the zoo +/* zoo_mark(): private function to make an entry to the zoo * returns 0 on success, -1 on error */ static int zoo_mark(zoo_t z, char *entry); static int zoo_lock(zoo_t z); @@ -76,7 +76,7 @@ zoo_getname() { char buf[1024]; char *zoo; - + zoo = getenv( "ZOO" ); if (zoo) { snprintf(buf, 1024, "%s/%s", zoo, "active"); @@ -101,8 +101,8 @@ zoo_open(char *zooname) new_zoo = (zoo_t)fopen(zooname, "a+"); if (!new_zoo) { /* total failure */ - snprintf(zoo_error, ZELEN, - "Could not open zoo as \"%s\", errno:%d %s", + snprintf(zoo_error, ZELEN, + "Could not open zoo as \"%s\", errno:%d %s", zooname, errno, strerror(errno)); return 0; } @@ -142,17 +142,17 @@ zoo_mark(zoo_t z, char *entry) if (fp == NULL) return -1; - + if (zoo_lock(z)) return -1; - + /* first fit */ rewind(fp); do { pos = ftell(fp); - if (fgets(buf, BUFLEN, fp) == NULL) + if (fgets(buf, BUFLEN, fp) == NULL) break; if (buf[0] == '#') { @@ -164,7 +164,7 @@ zoo_mark(zoo_t z, char *entry) errno, strerror(errno)); return -1; } - /* write the entry, left justified, and padded/truncated to the + /* write the entry, left justified, and padded/truncated to the * same size as the previous entry */ fprintf(fp, "%-*.*s\n", (int)strlen(buf)-1, (int)strlen(buf)-1, entry); found = 1; @@ -192,7 +192,7 @@ int zoo_mark_cmdline(zoo_t z, pid_t p, char *tag, char *cmdline) { char new_entry[BUFLEN]; - + snprintf(new_entry, 80, "%d,%s,%s", p, tag, cmdline); return zoo_mark(z, new_entry); } @@ -205,7 +205,7 @@ zoo_mark_args(zoo_t z, pid_t p, char *tag, int ac, char **av) cmdline = cat_args(ac, av); ret = zoo_mark_cmdline(z, p, tag, cmdline); - + free(cmdline); return ret; } @@ -230,7 +230,7 @@ zoo_clear(zoo_t z, pid_t p) do { pos = ftell(fp); - if (fgets(buf, BUFLEN, fp) == NULL) + if (fgets(buf, BUFLEN, fp) == NULL) break; if (buf[0] == '#') @@ -261,8 +261,8 @@ zoo_clear(zoo_t z, pid_t p) return -1; if (!found) { - snprintf(zoo_error, ZELEN, - "zoo_clear() did not find pid(%d)", + snprintf(zoo_error, ZELEN, + "zoo_clear() did not find pid(%d)", p); return 1; } @@ -270,7 +270,7 @@ zoo_clear(zoo_t z, pid_t p) } -pid_t +pid_t zoo_getpid(zoo_t z, char *tag) { FILE *fp = (FILE *)z; @@ -286,13 +286,13 @@ zoo_getpid(zoo_t z, char *tag) rewind(fp); do { - if (fgets(buf, BUFLEN, fp) == NULL) + if (fgets(buf, BUFLEN, fp) == NULL) break; if (buf[0] == '#') continue; /* recycled line */ - if ((s = strchr(buf, ',')) == NULL) + if ((s = strchr(buf, ',')) == NULL) continue; /* line was not expected format */ if (strncmp(s+1, tag, strlen(tag))) @@ -314,7 +314,7 @@ zoo_lock(zoo_t z) struct flock zlock; sigset_t block_these; int ret; - + if (fp == NULL) return -1; @@ -339,7 +339,7 @@ zoo_lock(zoo_t z) "failed to unlock zoo file, errno:%d %s", errno, strerror(errno)); return -1; - } + } return 0; } @@ -351,7 +351,7 @@ zoo_unlock(zoo_t z) struct flock zlock; sigset_t block_these; int ret; - + if (fp == NULL) return -1; @@ -377,7 +377,7 @@ zoo_unlock(zoo_t z) "failed to lock zoo file, errno:%d %s", errno, strerror(errno)); return -1; - } + } return 0; } @@ -393,8 +393,8 @@ cat_args(int argc, char **argv) } if ((cmd = (char *)malloc(size)) == NULL) { - snprintf(zoo_error, ZELEN, - "Malloc Error, %s/%d", + snprintf(zoo_error, ZELEN, + "Malloc Error, %s/%d", __FILE__, __LINE__); return NULL; } @@ -412,7 +412,7 @@ cat_args(int argc, char **argv) #if defined(UNIT_TEST) -void +void zt_add(zoo_t z, int n) { char cmdline[200]; @@ -420,10 +420,10 @@ zt_add(zoo_t z, int n) snprintf(tag, 10, "%s%d", "test", n); snprintf(cmdline, 200, "%s%d %s %s %s", "runtest", n, "one", "two", "three"); - + zoo_mark_cmdline(z, n, tag, cmdline); } - + int main(int argc, char *argv[]) { @@ -445,23 +445,23 @@ main(int argc, char *argv[]) printf("Error opennning zoo\n"); exit(-1); } - + zoo_mark_args(test_zoo, getpid(), test_tag, argc, argv); - + for (j = 0; j < 5; j++) { for (i = 0; i < 20; i++) { zt_add(test_zoo, i); } - + for (; i >=0; i--) { zoo_clear(test_zoo, i); } } - + zoo_clear(test_zoo, getpid()); - + return 0; } @@ -471,4 +471,4 @@ main(int argc, char *argv[]) -#endif +#endif
\ No newline at end of file |