Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to compilation and warnings on ubuntu 18.04 #132

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/output_cpp/gm_graph/src/graph_gen_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ int main(int argc, char** argv) {
exit(0);
}

node_t N = (node_t) atoll(argv[1]);
edge_t M = (edge_t) atoll(argv[2]);
node_t N = (node_t) strtoull(argv[1], NULL, 10);
edge_t M = (edge_t) strtoull(argv[2], NULL, 10);
int gtype = atoi(argv[4]);
if (N == 0) {printf("Empty graph not allowed\n"); return EXIT_FAILURE;}
printf("Creating Graph, N = %I64d, M = %I64d , Type = %d\n", (int64_t)N, (int64_t) M, gtype);
printf("Creating Graph, N = %" PRIi64 ", M = %" PRIi64 " , Type = %d\n", (int64_t)N, (int64_t)M, gtype);


gm_graph* g;
Expand Down
24 changes: 12 additions & 12 deletions src/common/gm_error.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ void gm_print_error_header() {
need_print = false;
}

void gm_type_error(int errno, ast_id* id, const char* str1, const char* str2) {
void gm_type_error(int errnumber, ast_id* id, const char* str1, const char* str2) {
gm_print_error_header();
if (curr_file != NULL) printf("%s:", curr_file);
printf("%d: %d: error: ", id->get_line(), id->get_col());
switch (errno) {
switch (errnumber) {
case GM_ERROR_INVALID_ITERATOR_FOR_RARROW:
printf("%s cannot be used in Edge() syntax.\n", id->get_orgname());
break;
Expand Down Expand Up @@ -89,12 +89,12 @@ void gm_type_error(int errno, ast_id* id, const char* str1, const char* str2) {
break;
}
}
void gm_type_error(int errno, int l, int c, const char* str1, const char* str2, const char* str3) {
void gm_type_error(int errnumber, int l, int c, const char* str1, const char* str2, const char* str3) {
gm_print_error_header();

if (curr_file != NULL) printf("%s:", curr_file);
printf("%d: %d: error: ", l, c);
switch (errno) {
switch (errnumber) {
case GM_ERROR_PAR_RETURN:
printf("return inside parallel consistency\n");
break;
Expand Down Expand Up @@ -196,11 +196,11 @@ void gm_type_error(int errno, int l, int c, const char* str1, const char* str2,
}
}

void gm_type_error(int errno, ast_id* id1, ast_id* id2) {
void gm_type_error(int errnumber, ast_id* id1, ast_id* id2) {
gm_print_error_header();
if (curr_file != NULL) printf("%s:", curr_file);
printf("%d: %d: error: ", id1->get_line(), id1->get_col());
switch (errno) {
switch (errnumber) {
case GM_ERROR_NONGRAPH_TARGET:
printf("%s is not a graph type object\n", id1->get_orgname());
break;
Expand Down Expand Up @@ -234,7 +234,7 @@ void gm_type_error(int errno, ast_id* id1, ast_id* id2) {
}
}

void gm_conf_error(int errno, gm_symtab_entry* target, ast_id* ev1, ast_id* ev2, bool is_warning) {
void gm_conf_error(int errnumber, gm_symtab_entry* target, ast_id* ev1, ast_id* ev2, bool is_warning) {
gm_print_error_header();
if (curr_file != NULL) printf("%s:", curr_file);

Expand All @@ -246,7 +246,7 @@ void gm_conf_error(int errno, gm_symtab_entry* target, ast_id* ev1, ast_id* ev2,
ast_id* target_id = target->getId();
char* name = target_id->get_orgname();

switch (errno) {
switch (errnumber) {
case GM_ERROR_READ_WRITE_CONFLICT:
printf("Property %s may have read-write conflict: read at line:%d, write at line:%d\n", name, ev1->get_line(), ev2->get_line());
break;
Expand Down Expand Up @@ -277,10 +277,10 @@ void gm_conf_error(int errno, gm_symtab_entry* target, ast_id* ev1, ast_id* ev2,
}

// todo: should be differend error routines for different back-ends
void gm_backend_error(int errno, const char* str1, const char* str2) {
void gm_backend_error(int errnumber, const char* str1, const char* str2) {
gm_print_error_header();
if (curr_file != NULL) printf("%s:", curr_file);
switch (errno) {
switch (errnumber) {
case GM_ERROR_FILEWRITE_ERROR:
printf("cannot open file %s for write\n", str1);
break;
Expand All @@ -302,11 +302,11 @@ void gm_backend_error(int errno, const char* str1, const char* str2) {
break;
}
}
void gm_backend_error(int errno, int l, int c, const char* str1) {
void gm_backend_error(int errnumber, int l, int c, const char* str1) {
gm_print_error_header();
if (curr_file != NULL) printf("%s:", curr_file);
printf("%d: %d: error: ", l, c);
switch (errno) {
switch (errnumber) {
case GM_ERROR_GPS_EDGE_SEND_VERSIONS:
printf("Communicating multiple versions of edge value in one message: %s\n", str1);
break;
Expand Down
2 changes: 1 addition & 1 deletion src/inc/gm_builtin.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <list>
#include <map>

#define AUX_INFO(X,Y) TO_STR(X)":"TO_STR(Y)
#define AUX_INFO(X,Y) TO_STR(X) ":" TO_STR(Y)

#define GM_BLTIN_MUTATE_GROW 1
#define GM_BLTIN_MUTATE_SHRINK 2
Expand Down
Loading