From: Harishankar Date: Mon, 11 May 2020 09:59:06 +0000 (+0530) Subject: Minor fix to compiling with gcc and gcc related warning X-Git-Tag: 0.2a X-Git-Url: https://harishankar.org/repos/?a=commitdiff_plain;h=4dc5adcef4e6652b07b00087a24fc3d1305a6f81;p=wordblah.git Minor fix to compiling with gcc and gcc related warning Fixed bug in the Makefile to compile with gcc where the library was not getting linked properly with the gcc command line. Also fixed a gcc compiler warning about typecasting NULL in initalizing char array by using '\0' (null terminator character) instead of NULL. --- diff --git a/Makefile b/Makefile index 6bd7b90..0cbcb1b 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ all: wordblah wordblah_player wordblah: wordblah.c wordblah.h constantstrings.h - clang wordblah.c -lgd -lz -lcrypto -o wordblah - + clang wordblah.c -o wordblah -lgd -lz -lcrypto + wordblah_player: wordblah_player.c wordblah.h wordblah.gresource.xml wordblah_player.glade constantstrings.h glib-compile-resources wordblah.gresource.xml --target wordblah_resource.c --generate-source - clang -rdynamic -lz -lgd -lcrypto -o wordblah_player wordblah_player.c -Wall `pkg-config --cflags --libs gtk+-3.0` + clang -rdynamic -o wordblah_player wordblah_player.c -Wall `pkg-config --cflags --libs gtk+-3.0` -lgd -lz -lcrypto diff --git a/wordblah.h b/wordblah.h index c641abc..13874dc 100644 --- a/wordblah.h +++ b/wordblah.h @@ -133,7 +133,7 @@ bool verify_solution_password (Puzzle *p, const char* password) unsigned int len; digest_message ((const unsigned char *)password, strlen(password), &hashed_sol_password, &len); - char hashed_hex_pwd[256] = { (char) NULL }; + char hashed_hex_pwd[256] = { '\0' }; encode_binary (hashed_hex_pwd, hashed_sol_password, len); if (strcmp (p->hashed_solution_password, hashed_hex_pwd) == 0) @@ -155,7 +155,7 @@ bool verify_master_password (Puzzle *p, const char* password) unsigned int len; digest_message ((const unsigned char *)password, strlen(password), &hashed_mas_password, &len); - char hashed_hex_pwd[256] = { (char) NULL }; + char hashed_hex_pwd[256] = { '\0' }; encode_binary (hashed_hex_pwd, hashed_mas_password, len); if (strcmp (p->hashed_master_password, hashed_hex_pwd) == 0)