Cleans up compile output, only half dozen warnings

This commit is contained in:
Jeff Harris 2019-11-15 16:23:23 -08:00
parent 2fac6bead3
commit 5944ae4b75
7 changed files with 29 additions and 38 deletions

View File

@ -10,15 +10,15 @@ DEPS := $(OBJS:.o=.d)
INC_DIRS := $(shell find $(SRC_DIRS) -type d) INC_DIRS := $(shell find $(SRC_DIRS) -type d)
INC_FLAGS := $(addprefix -I,$(INC_DIRS)) INC_FLAGS := $(addprefix -I,$(INC_DIRS))
CPPFLAGS ?= $(INC_FLAGS) -MMD -MP CFLAGS ?= $(INC_FLAGS) -Wno-return-type -Wno-missing-declarations
$(BUILD_DIR)/$(TARGET_EXEC): $(OBJS) $(BUILD_DIR)/$(TARGET_EXEC): $(OBJS)
$(CC) $(OBJS) -o $@ $(LDFLAGS) $(CC) $(OBJS) -o $@ $(LDFLAGS)
# c source # c source
$(BUILD_DIR)/%.c.o: %.c $(BUILD_DIR)/%.c.o: %.c
$(MKDIR_P) $(dir $@) @$(MKDIR_P) $(dir $@)
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@ @$(CC) $(CFLAGS) -c $< -o $@
.PHONY: clean .PHONY: clean

View File

@ -1,7 +1,7 @@
#include "diag.h" #include "diag.h"
#include "fwsetup.h" #include "fwsetup.h"
#include "printf.h" #include "printf.h"
#include "stdlib.h" #include "brstdlib.h"
#include <stdarg.h> #include <stdarg.h>
// Global variables // Global variables
@ -21,7 +21,7 @@ void BrFailure(const char *s, ...) {
if (fw.err->error == NULL) { if (fw.err->error == NULL) {
BrAbort(); BrAbort();
} }
fw.err->error(_diag_scratch); fw.err->error(_diag_scratch);
va_end(args); va_end(args);
} }
@ -39,7 +39,7 @@ void BrWarning(const char *s, ...) {
if (fw.err->message == NULL) { if (fw.err->message == NULL) {
BrAbort(); BrAbort();
} }
fw.err->message(_diag_scratch); fw.err->message(_diag_scratch);
va_end(args); va_end(args);
} }
@ -51,12 +51,12 @@ void BrFatal(const char *name, int line, const char *s, ...) {
int n; int n;
va_start(args, s); va_start(args, s);
n = BrSprintF(_diag_scratch, "FATAL %s:%d\n", name, line); n = BrSprintf(_diag_scratch, "FATAL %s:%d\n", name, line);
BrVSprintf(&_diag_scratch[n], s, args); BrVSprintf(&_diag_scratch[n], s, args);
if (fw.err->error == NULL) { if (fw.err->error == NULL) {
BrAbort(); BrAbort();
} }
fw.err->error(_diag_scratch); fw.err->error(_diag_scratch);
va_end(args); va_end(args);
} }
@ -67,7 +67,7 @@ void _BrAssert(const char *condition, const char *file, unsigned int line) {
if (fw.err->error == NULL) { if (fw.err->error == NULL) {
BrAbort(); BrAbort();
} }
BrSprintf(_diag_scratch, "ASSERTION FAILED %s:%d: \"%s\"\n", file, line, condition); BrSprintf(_diag_scratch, "ASSERTION FAILED %s:%d: \"%s\"\n", file, line, condition);
fw.err->error(_diag_scratch); fw.err->error(_diag_scratch);
} }
@ -78,7 +78,7 @@ void _BrUAssert(const char *condition, const char *file, unsigned int line) {
if (fw.err->error == NULL) { if (fw.err->error == NULL) {
BrAbort(); BrAbort();
} }
BrSprintf(_diag_scratch, "ASSERTION FAILED %s:%d: \"%s\"\n", file, line, condition); BrSprintf(_diag_scratch, "ASSERTION FAILED %s:%d: \"%s\"\n", file, line, condition);
fw.err->error(_diag_scratch); fw.err->error(_diag_scratch);
} }

View File

@ -1,10 +1,13 @@
#include "stdlib.h" #include "brstdlib.h"
#include <ctype.h>
#include <errno.h> #include <errno.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
// Global variables // Global variables
// DOSPICK has "$Id: stdlib.c 2.4 1996/12/06 21:18:39 sam Exp $" for this. Do we want to implement these? // DOSPICK has "$Id: stdlib.c 2.4 1996/12/06 21:18:39 sam Exp $" for this. Do we want to implement these?
char rscid[48]; char rscid[48];
@ -163,13 +166,13 @@ br_int_32 BrVSprintfN(char *buf, br_size_t buf_size, char *fmt, va_list args) {
// Most C libs have vsnprintf these days that can replace this. // Most C libs have vsnprintf these days that can replace this.
unsigned int n; unsigned int n;
char tmp[512]; char tmp[512];
n = vsprintf(tmp, fmt, args); n = vsprintf(tmp, fmt, args);
if (buf_size - 1 < n) { if (buf_size - 1 < n) {
n = buf_size - 1; n = buf_size - 1;
} }
strncpy(buf, tmp, n); strncpy(buf, tmp, n);
buf[n] = '\0'; buf[n] = '\0';
} }

View File

@ -1,5 +1,9 @@
#ifndef _STDLIB_H_ /*
#define _STDLIB_H_ * Renamed from stdlib.h to avoid collisions with c std lib
*/
#ifndef _BRSTDLIB_H_
#define _BRSTDLIB_H_
#include "dr_types.h" #include "dr_types.h"
#include "br_types.h" #include "br_types.h"

View File

@ -1,5 +1,7 @@
#include "stdfile.h" #include "stdfile.h"
#include <stdio.h> #include <stdio.h>
#include <string.h>
// Global variables // Global variables
br_filesystem BrStdioFilesystem = { br_filesystem BrStdioFilesystem = {
@ -47,7 +49,7 @@ void* BrStdioOpenWrite(char *name, int mode) {
if(mode == BR_FS_MODE_TEXT) { if(mode == BR_FS_MODE_TEXT) {
fh = fopen(name, "w"); fh = fopen(name, "w");
} else { } else {
fh = fopen(name, "wb"); fh = fopen(name, "wb");
} }
return fh; return fh;
@ -93,7 +95,7 @@ br_size_t BrStdioWrite(void *buf, br_size_t size, unsigned int n, void *f) {
// Size: 141 // Size: 141
br_size_t BrStdioGetLine(char *buf, br_size_t buf_len, void *f) { br_size_t BrStdioGetLine(char *buf, br_size_t buf_len, void *f) {
br_size_t l; br_size_t l;
if (fgets(buf, buf_len, f) == NULL) { if (fgets(buf, buf_len, f) == NULL) {
return 0; return 0;
} }

View File

@ -1,5 +1,7 @@
#include "stdmem.h" #include "stdmem.h"
#include <stdlib.h>
// Global variables // Global variables
char rscid[48]; char rscid[48];
br_allocator BrStdlibAllocator = {"malloc", BrStdlibAllocate, BrStdlibFree, BrStdlibInquire, BrStdlibAlign}; br_allocator BrStdlibAllocator = {"malloc", BrStdlibAllocate, BrStdlibFree, BrStdlibInquire, BrStdlibAlign};

View File

@ -484,26 +484,6 @@ typedef void zs_order_table_traversal_cbfn(int, ot_vertex*, ot_vertex*, ot_verte
typedef void tS3_outlet_callback(tS3_outlet_ptr, tS3_sound_tag, tS3_termination_reason); typedef void tS3_outlet_callback(tS3_outlet_ptr, tS3_sound_tag, tS3_termination_reason);
typedef void tS3_sample_filter(tS3_effect_tag, tS3_sound_tag); typedef void tS3_sample_filter(tS3_effect_tag, tS3_sound_tag);
typedef struct div_t {
int quot;
int rem;
} div_t;
typedef struct ldiv_t {
long quot;
long rem;
} ldiv_t;
typedef struct _complex {
double x;
double y;
} _complex;
typedef struct complex {
double x;
double y;
} complex;
typedef struct exception { typedef struct exception {
int type; int type;
char *name; char *name;