Browse Source

Fix warnings in tests

Serj Kalichev 1 year ago
parent
commit
666dafd5e9
3 changed files with 3 additions and 4 deletions
  1. 1 1
      faux/argv/testc_argv.c
  2. 1 1
      faux/buf/testc_buf.c
  3. 1 2
      faux/str/testc_str.c

+ 1 - 1
faux/argv/testc_argv.c

@@ -117,7 +117,7 @@ int testc_faux_argv_index(void)
 	int retval = 0;
 	ssize_t num = 0;
 	ssize_t num_etalon = 3;
-	size_t index = 0;
+	ssize_t index = 0;
 
 	printf("Line   : [%s]\n", line);
 

+ 1 - 1
faux/buf/testc_buf.c

@@ -567,7 +567,7 @@ int testc_faux_buf_mass(void)
 	}
 	// Buf length
 	printf("faux_buf_len()\n");
-	if (faux_buf_len(buf) != tlw) {
+	if (faux_buf_len(buf) != (ssize_t)tlw) {
 		fprintf(stderr, "faux_buf_len() error\n");
 		return -1;
 	}

+ 1 - 2
faux/str/testc_str.c

@@ -66,7 +66,7 @@ int testc_faux_str_getline(void)
 		"arg 2",
 		NULL
 		 };
-	ssize_t num_etalon = 3;
+	size_t num_etalon = 3;
 	size_t index = 0;
 	char *str = NULL;
 	const char *saveptr = NULL;
@@ -76,7 +76,6 @@ int testc_faux_str_getline(void)
 	saveptr = line;
 	while ((str = faux_str_getline(saveptr, &saveptr)) && (index < num_etalon)) {
 		int r = -1;
-		const char *res = NULL;
 		printf("Etalon %ld : [%s]\n", index, etalon[index]);
 		r = strcmp(etalon[index], str);
 		if (r < 0) {