aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2020-12-19 00:42:20 +0100
committerJan200101 <sentrycraft123@gmail.com>2020-12-19 00:42:20 +0100
commit88b8a63729c6c322c8bb456fd0f921846f48d751 (patch)
tree5a852cf8011d5c3bdae913830f97b067abdb7252
parent79e6835eb9478680530e66e12dc365993a08b788 (diff)
downloadpolecat-88b8a63729c6c322c8bb456fd0f921846f48d751.tar.gz
polecat-88b8a63729c6c322c8bb456fd0f921846f48d751.zip
add conversion warnings, fix existing flaws
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/common.c6
-rw-r--r--src/lutris.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 805cf91..37c8c08 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,6 +39,6 @@ target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC ${LIBCURL_INCLUDE_DIRS})
target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC ${JSONC_INCLUDE_DIRS})
target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC ${LIBARCHIVE_INCLUDE_DIRS})
-target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -Wall -Wextra -pedantic)
+target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic -Wconversion)
install(TARGETS ${CMAKE_PROJECT_NAME})
diff --git a/src/common.c b/src/common.c
index 17edbd9..29aa3db 100644
--- a/src/common.c
+++ b/src/common.c
@@ -12,18 +12,18 @@
void print_help(const struct Command* commands, const size_t size)
{
- int longestCommand = 0;
+ size_t longestCommand = 0;
for (size_t i = 0; i < size; ++i)
{
- int commandLength = strlen(commands[i].name);
+ size_t commandLength = strlen(commands[i].name);
if (commandLength > longestCommand) longestCommand = commandLength;
}
for (size_t i = 0; i < size; ++i)
{
- printf("\t%-*s\t %s\n", longestCommand, commands[i].name, commands[i].description);
+ printf("\t%-*s\t %s\n", (int)longestCommand, commands[i].name, commands[i].description);
}
}
diff --git a/src/lutris.c b/src/lutris.c
index 4bc0f0f..b80d830 100644
--- a/src/lutris.c
+++ b/src/lutris.c
@@ -22,7 +22,7 @@ COMMAND(lutris, install)
if (argc == 2)
{
struct script_t installer = lutris_getInstaller(argv[1]);
- char inp;
+ int inp;
if (installer.error == NONE)
{
@@ -30,7 +30,7 @@ COMMAND(lutris, install)
printf("Install %s - %s to the current directory?\nThis may download files and install wine versions\n(y/n)\n", installer.name, installer.version);
- if ((inp=getchar()) == 'y')
+ if ((inp = getchar()) == 'y')
{
// fetch all files required by installer
// TODO: think about storing files on disk for larger files