GITINFO != git describe --always
.endif
-CFLAGS += -Wall -Wextra -Werror -fno-strict-aliasing -DGMQCC_GITINFO=\"$(GITINFO)\"$(OPTIONAL)
+CFLAGS += -Wall -Wextra -Werror -Wstrict-aliasing
.if $(CC) == clang
CFLAGS += -Weverything\
-Wno-format-nonliteral\
-Wno-disabled-macro-expansion\
-Wno-conversion\
- -Wno-missing-prototypes\
-Wno-float-equal\
-Wno-unknown-warning-option\
-Wno-cast-align\
- -Wstrict-prototypes
+ -pedantic-errors
.else
-. if $(CC) == tcc
- CFLAGS += -Wstrict-prototypes -pedantic-errors
+. if $(CC) != g++
+ CFLAGS += -Wmissing-prototypes -Wstrict-prototypes
+. endif
+
+. if $(CC) != tcc
+ CFLAGS += -pedantic-errors
. else
CFLAGS += -Wno-pointer-sign -fno-common
. endif
.endif
+CFLAGS += -DGMQCC_GITINFO=\"$(GITINFO)\" $(OPTIONAL)
DEPS != for i in $(OBJ_C) $(OBJ_P) $(OBJ_T) $(OBJ_X); do echo $$i; done | sort | uniq
QCVM = qcvm
#standard rules
c.o: ${.IMPSRC}
- $(CC) -c ${.IMPSRC} -o ${.TARGET} $(CPPFLAGS) $(CFLAGS)
+ $(CC) -c ${.IMPSRC} -o ${.TARGET} $(CFLAGS) $(CPPFLAGS)
exec-standalone.o: exec.c
- $(CC) -c ${.ALLSRC} -o ${.TARGET} $(CPPFLAGS) $(CFLAGS) -DQCVM_EXECUTOR=1
+ $(CC) -c ${.ALLSRC} -o ${.TARGET} $(CFLAGS) $(CPPFLAGS) -DQCVM_EXECUTOR=1
$(QCVM): $(OBJ_X)
$(CC) -o ${.TARGET} ${.IMPSRC} $(LDFLAGS) $(LIBS) $(OBJ_X)
CYGWIN = $(findstring CYGWIN, $(UNAME))
MINGW = $(findstring MINGW32, $(UNAME))
-CFLAGS += -O3 -Wall -Wextra -Wstrict-aliasing -Werror $(OPTIONAL)
-ifneq ($(shell git describe --always 2>/dev/null),)
- CFLAGS += -DGMQCC_GITINFO="\"$(shell git describe --always)\""
-endif
+CFLAGS += -Wall -Wextra -Werror -Wstrict-aliasing
#turn on tons of warnings if clang is present
# but also turn off the STUPID ONES
ifeq ($(CC), clang)
-Wno-format-nonliteral \
-Wno-disabled-macro-expansion \
-Wno-conversion \
- -Wno-missing-prototypes \
-Wno-float-equal \
-Wno-unknown-warning-option \
-Wno-cast-align \
- -Wstrict-prototypes
+ -pedantic-errors
else
- #Tiny C Compiler doesn't know what -pedantic-errors is
- # and instead of ignoring .. just errors.
+ ifneq ($(CC), g++)
+ CFLAGS += -Wmissing-prototypes -Wstrict-prototypes
+ endif
+
ifneq ($(CC), tcc)
CFLAGS += -pedantic-errors
else
CFLAGS += -Wno-pointer-sign -fno-common
endif
-
- #-Wstrict-prototypes is not valid in g++
- ifneq ($(CC), g++)
- CFLAGS += -Wstrict-prototypes
- endif
endif
+ifneq ($(shell git describe --always 2>/dev/null),)
+ CFLAGS += -DGMQCC_GITINFO="\"$(shell git describe --always)\""
+endif
+
+# do this last otherwise there is whitespace in the command output and
+# it makes my OCD act up
+CFLAGS += $(OPTIONAL)
+
#we have duplicate object files when dealing with creating a simple list
#for dependinces. To combat this we use some clever recrusive-make to
#filter the list and remove duplicates which we use for make depend
#standard rules
%.o: %.c
- $(CC) -c $< -o $@ $(CPPFLAGS) $(CFLAGS)
+ $(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS)
exec-standalone.o: exec.c
- $(CC) -c $< -o $@ $(CPPFLAGS) $(CFLAGS) -DQCVM_EXECUTOR=1
+ $(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS) -DQCVM_EXECUTOR=1
$(QCVM): $(OBJ_X)
$(CC) -o $@ $^ $(LDFLAGS) $(LIBS)
* directly out to allocated memory. Which is actually very useful for the future library support
* we're going to add.
*/
-bool code_write_memory(code_t *code, uint8_t **datmem, size_t *sizedat, uint8_t **lnomem, size_t *sizelno) {
+#if 0
+static bool code_write_memory(code_t *code, uint8_t **datmem, size_t *sizedat, uint8_t **lnomem, size_t *sizelno) GMQCC_UNUSED {
prog_header_t code_header;
uint32_t offset = 0;
code_stats("<<memory>>", (lnomem) ? "<<memory>>" : NULL, code, &code_header);
return true;
}
+#endif /*!#if 0 reenable when ready to be used */
#undef WRITE_CHUNK
bool code_write(code_t *code, const char *filename, const char *lnofile) {
return (qcany_t*)(prog->entitydata + (prog->entityfields * e));
}
-qcint_t prog_spawn_entity(qc_program_t *prog) {
+static qcint_t prog_spawn_entity(qc_program_t *prog) {
char *data;
qcint_t e;
for (e = 0; e < (qcint_t)vec_size(prog->entitypool); ++e) {
return e;
}
-void prog_free_entity(qc_program_t *prog, qcint_t e) {
+static void prog_free_entity(qc_program_t *prog, qcint_t e) {
if (!e) {
prog->vmerror++;
fprintf(stderr, "Trying to free world entity\n");
}
}
-void escapestring(char* dest, const char* src) {
+static void escapestring(char* dest, const char* src) {
char c;
while ((c = *(src++))) {
switch(c) {
return NULL;
}
-static GMQCC_INLINE ast_expression *fold_op_andor(fold_t *fold, ast_value *a, ast_value *b, float or) {
+static GMQCC_INLINE ast_expression *fold_op_andor(fold_t *fold, ast_value *a, ast_value *b, float expr) {
if (fold_can_2(a, b)) {
if (OPTS_FLAG(PERL_LOGIC)) {
if (fold_immediate_true(fold, a))
} else {
return fold_constgen_float (
fold,
- ((or) ? (fold_immediate_true(fold, a) || fold_immediate_true(fold, b))
- : (fold_immediate_true(fold, a) && fold_immediate_true(fold, b)))
+ ((expr) ? (fold_immediate_true(fold, a) || fold_immediate_true(fold, b))
+ : (fold_immediate_true(fold, a) && fold_immediate_true(fold, b)))
? 1
: 0
);
return -1;
}
+bool ftepp_predef_exists(const char *name);
bool ftepp_predef_exists(const char *name) {
return ftepp_predef_index(name) != -1;
}
* Like pak_insert_one, except this collects files in all directories
* from a root directory, and inserts them all.
*/
-bool pak_insert_all(pak_file_t *pak, const char *dir) {
+#if 0
+static bool pak_insert_all(pak_file_t *pak, const char *dir) {
DIR *dp;
struct dirent *dirp;
fs_dir_close(dp);
return true;
}
+#endif /*!if 0 renable when ready to use */
static bool pak_close(pak_file_t *pak) {
size_t itr;
}
/* not to be exposed */
-extern bool ftepp_predef_exists(const char *name);
-
+bool ftepp_predef_exists(const char *name);
static bool parse_sya_operand(parser_t *parser, shunt *sy, bool with_labels)
{
if (OPTS_FLAG(TRANSLATABLE_STRINGS) &&
parseerror(parser, "error parsing break definition");
break;
}
- (void)!!parsewarning(parser, WARN_BREAKDEF, "break definition ignored (suggest removing it)");
+ (void)!parsewarning(parser, WARN_BREAKDEF, "break definition ignored (suggest removing it)");
} else {
parseerror(parser, "missing semicolon or initializer, got: `%s`", parser_tokval(parser));
break;
stat_mem_peak = stat_mem_high;
free(oldinfo);
-
return newinfo + 1;
}
return util_htgeth(ht, key, util_hthash(ht, key));
}
+void *code_util_str_htgeth(hash_table_t *ht, const char *key, size_t bin);
void *code_util_str_htgeth(hash_table_t *ht, const char *key, size_t bin) {
hash_node_t *pair;
size_t len, keylen;