Skip to content

Commit

Permalink
Fix warnings on FreeBSD
Browse files Browse the repository at this point in the history
  • Loading branch information
stesser authored and Gavin Howard committed May 4, 2020
1 parent 7e7e1b0 commit de3c40b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/opt.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ typedef enum BcOptType {
} BcOptType;

typedef struct BcOptLong {
char *name;
const char *name;
BcOptType type;
int val;
} BcOptLong;
Expand Down
6 changes: 3 additions & 3 deletions src/opt.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static bool bc_opt_longoptsEnd(const BcOptLong *longopts, size_t i) {
return !longopts[i].name && !longopts[i].val;
}

static char* bc_opt_longopt(const BcOptLong *longopts, int c) {
static const char* bc_opt_longopt(const BcOptLong *longopts, int c) {

size_t i;

Expand All @@ -62,7 +62,7 @@ static char* bc_opt_longopt(const BcOptLong *longopts, int c) {
return "NULL";
}

static int bc_opt_error(BcError err, int c, char *str) {
static int bc_opt_error(BcError err, int c, const char *str) {

int result;

Expand Down Expand Up @@ -216,7 +216,7 @@ int bc_opt_parse(BcOpt *o, const BcOptLong *longopts) {

for (i = 0; !bc_opt_longoptsEnd(longopts, i); i++) {

char *name = longopts[i].name;
const char *name = longopts[i].name;

if (bc_opt_longoptsMatch(name, option)) {

Expand Down

0 comments on commit de3c40b

Please sign in to comment.