Skip to content

Commit

Permalink
Merge pull request #97 from olin/newsch/compiler-warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
newsch authored Aug 29, 2020
2 parents a5d4f34 + 7a31b2d commit 6e76b48
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CC=gcc
CFLAGS+=-Wall -std=gnu99 -no-pie
CFLAGS+=-Wall -Wpedantic -std=gnu99 -no-pie

version = $(shell git describe --always --tags --dirty)
CFLAGS+="-DVERSION=\"$(version)\""
Expand Down
2 changes: 1 addition & 1 deletion src/lib/argtable3.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ static unsigned int enhanced_hash(arg_hashtable_t* h, void* k) {

static unsigned int index_for(unsigned int tablelength, unsigned int hashvalue) {
return (hashvalue % tablelength);
};
}

arg_hashtable_t* arg_hashtable_create(unsigned int minsize, unsigned int (*hashfn)(void*), int (*eqfn)(void*, void*)) {
arg_hashtable_t* h;
Expand Down
15 changes: 2 additions & 13 deletions src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,8 @@ static inline void _log_unused(const int dummy, ...) {
// min/max macros
// from https://stackoverflow.com/questions/3437404/min-and-max-in-c

#define max(a, b) \
({ \
__typeof__(a) _a = (a); \
__typeof__(b) _b = (b); \
_a > _b ? _a : _b; \
})

#define min(a, b) \
({ \
__typeof__(a) _a = (a); \
__typeof__(b) _b = (b); \
_a < _b ? _a : _b; \
})
#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) < (b) ? (a) : (b))

// ncurses-compatible CTRL+KEY definition
// NOTE: c should be lowercase
Expand Down

0 comments on commit 6e76b48

Please sign in to comment.