diff --git a/bm_utils.c b/bm_utils.c index af4f7ba..5b99d61 100644 --- a/bm_utils.c +++ b/bm_utils.c @@ -130,17 +130,20 @@ yes_no(char *prompt) #pragma warning(default:4127) #endif printf("%s [Y/N]: ", prompt); - gets(reply); - switch (*reply) + // HYRISE: Replace gets() with fgets(). Add if. + if (fgets(reply, sizeof(reply), stdin) != NULL) { - case 'y': - case 'Y': - return (1); - case 'n': - case 'N': - return (0); - default: - printf("Please answer 'yes' or 'no'.\n"); + switch (*reply) + { + case 'y': + case 'Y': + return (1); + case 'n': + case 'N': + return (0); + default: + printf("Please answer 'yes' or 'no'.\n"); + } } } } @@ -577,7 +580,7 @@ set_state(int table, long sf, long procs, long step, long *extra_rows) if (step > procs) /* moving to the end to generate updates */ { // HYRISE: The following line raises a compilation error when adding function prototypes the the tdef gen_seed - // member, as they epxect two arguments. All seed generators passed in driver.c (L 230-249) take either two + // member, as they expect two arguments. All seed generators passed in driver.c (L 230-249) take either two // parameters or are simply 0. Thus, calling this line would always lead to an error. With this assumption, we // simply ensure we fail if this should ever be called (did not happen after generating tables for multiple // scale factors). diff --git a/config.h b/config.h index 91833cb..87a5432 100644 --- a/config.h +++ b/config.h @@ -101,7 +101,10 @@ #endif /* LINUX */ #ifdef MAC +// HYRISE: Only define if not already defined. +#ifndef _POSIX_SOURCE #define _POSIX_SOURCE +#endif /* _POSIX_SOURCE */ #define STDLIB_HAS_GETOPT #endif /* MAC */ diff --git a/makefile b/makefile index d62d235..58ce2a8 100644 --- a/makefile +++ b/makefile @@ -16,7 +16,7 @@ WORKLOAD =SSBM # add -EDTERABYTE if orderkey will execeed 32 bits (SF >= 300) # and make the appropriate change in gen_schema() of runit.sh # HYRISE: Change -O to -O3. Add -Wno-dangling-else, -Wno-int-to-void-pointer-cast, and -Wno-void-pointer-to-int-cast because they are all over the codebase. -CFLAGS = -O3 -DDBNAME=\"dss\" -D$(MACHINE) -D$(DATABASE) -D$(WORKLOAD) -Wno-dangling-else -Wno-int-to-void-pointer-cast -Wno-void-pointer-to-int-cast +CFLAGS = -O3 -DDBNAME=\"dss\" -D$(MACHINE) -D$(DATABASE) -D$(WORKLOAD) -Wno-dangling-else -Wno-int-to-void-pointer-cast -Wno-void-pointer-to-int-cast -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast LDFLAGS = -O3 # The OBJ,EXE and LIB macros will need to be changed for compilation under # Windows NT diff --git a/varsub.c b/varsub.c index 5683b7c..c36ff7e 100644 --- a/varsub.c +++ b/varsub.c @@ -134,8 +134,8 @@ varsub(int qnum, int vnum, int flags) break; case 6: tmp_date = UnifInt(93,97,qnum); - sprintf(param[1], "19%d-01-01", tmp_date); - // HYRISE: Change format specifier. + sprintf(param[1], "19%d-01-01", tmp_date); + // HYRISE: Change format specifier. sprintf(param[2], "0.0%ld", UnifInt(2, 9, qnum)); sprintf(param[3], "%ld", UnifInt((long)24, (long)25, (long)qnum)); param[4][0] = '\0';