# env["LDFLAGS"] += ["-g", "-fsanitize=undefined,address"]
env["CPPPATH"] += %w[. inc]
env["LIBPATH"] += %w[.]
+ env["CFLAGS"] << "-DNDEBUG"
# Build library and binaries
env.Library("libtide.a", glob("src/lib/**/*.c"))
longjmp(ExitPad, 1);
} else {
assert(!"Unexpected exit. Something went wrong");
+ abort(); // if NDEBUG defined
}
}
#endif
#include <sys/stat.h>
#include "config.h"
+#ifndef NDEBUG
static bool buf_logvalid(Log* log) {
bool result = true;
for (; result && log; log = log->next) {
&& (buf_selvalid(buf))
);
}
+#endif
/* Creation, Resizing, Loading, and Saving
******************************************************************************/
#include <stdio.h>
#include <signal.h>
+#ifndef NDEBUG
+
static char ErrMsg[8192];
static char* DumpPath = NULL;
static void (*DumpFn)(FILE*) = NULL;
signal(SIGALRM, handle_signal);
alarm(1); /* Start new alarm */
}
+
+#endif
void paste(char* arg) {
int pasted = x11_sel_get(&X, CLIPBOARD, onpaste);
assert(pasted);
+ (void)pasted;
}
void copy(char* arg) {
#include <ctype.h>
#include "config.h"
+#ifndef NDEBUG
static bool view_valid(View* view) {
return (
(view->sync_flags <= 3u)
// && (view->rows != NULL)
);
}
+#endif
/* Provided by x11.c */
extern size_t glyph_width(View* view, int c);
fprintf(f, "\t.rows:\t\t%p\n", (void*)Regions[i].rows);
fprintf(f, "\t.buffer:\n");
fprintf(f, "\t\t.status:\t%d\n", Regions[i].buffer.status);
- fprintf(f, "\t\t.modtime:\t%lu\n", Regions[i].buffer.modtime);
+ fprintf(f, "\t\t.modtime:\t%lu\n", (unsigned long)Regions[i].buffer.modtime);
fprintf(f, "\t\t.bufsize:\t%zu\n", Regions[i].buffer.bufsize);
fprintf(f, "\t\t.bufstart:\t%p\n", (void*)Regions[i].buffer.bufstart);
fprintf(f, "\t\t.bufend:\t%p\n", (void*)Regions[i].buffer.bufend);