Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Commit

Permalink
Merge pull request #44 from abeaumont/fix/various-fixes
Browse files Browse the repository at this point in the history
A pair of fixes
  • Loading branch information
abeaumont authored Nov 3, 2017
2 parents 3164ace + 8acb027 commit 663140f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/uast.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void Error(void *ctx, const char *msg, ...);
///////// PUBLIC API /////////
//////////////////////////////

Nodes *NodesNew() { return calloc(1, sizeof(Nodes)); }
Nodes *NodesNew(void) { return calloc(1, sizeof(Nodes)); }

void NodesFree(Nodes *nodes) {
if (nodes) {
Expand All @@ -57,7 +57,7 @@ void *NodeAt(const Nodes *nodes, int index) {
}

Uast *UastNew(NodeIface iface) {
memset(error_message, BUF_SIZE, 0);
memset(error_message, 0, BUF_SIZE);
Uast *ctx = calloc(1, sizeof(Uast));
if (!ctx) {
Error(NULL, "Unable to get memory\n");
Expand Down Expand Up @@ -137,7 +137,7 @@ Nodes *UastFilter(const Uast *ctx, void *node, const char *query) {
return nodes;
}

char *LastError() {
char *LastError(void) {
return strndup(error_message, BUF_SIZE);
}

Expand Down
2 changes: 1 addition & 1 deletion src/uast.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Nodes *UastFilter(const Uast *ctx, void *node, const char *query);
// It may be an empty string if there's been no error.
//
// Memory for the string is obtained with malloc, and can be freed with free.
char *LastError();
char *LastError(void);

#ifdef __cplusplus
} // extern "C"
Expand Down
2 changes: 1 addition & 1 deletion src/uast_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extern "C" {
// These functions are used internally for testing and not exported.

// Returns a new Nodes structure
Nodes *NodesNew();
Nodes *NodesNew(void);

// Sets the size of nodes, allocating space if needed.
// Returns 0 if the size was changed correctly.
Expand Down

0 comments on commit 663140f

Please sign in to comment.