Fix unecessary assert with always true assertions in gio/gresource-tool.c

gio/gresource-tool.c: In function ‘elf_foreach_resource_section’:
gio/gresource-tool.c:190:22: error: comparison of unsigned expression in ‘>= 0’ is always true
  190 |   g_assert (shstrndx >= 0);
      |                      ^~
gio/gresource-tool.c:193:19: error: comparison of unsigned expression in ‘>= 0’ is always true
  193 |   g_assert (shnum >= 0);
      |                   ^~
This commit is contained in:
Emmanuel Fleury 2020-11-18 20:41:48 +01:00
parent 1f23770bc3
commit 0214d892ba

View File

@ -180,17 +180,18 @@ elf_foreach_resource_section (Elf *elf,
SectionCallback callback, SectionCallback callback,
gpointer data) gpointer data)
{ {
int ret;
size_t shstrndx, shnum; size_t shstrndx, shnum;
size_t scnidx; size_t scnidx;
Elf_Scn *scn; Elf_Scn *scn;
GElf_Shdr *shdr, shdr_mem; GElf_Shdr *shdr, shdr_mem;
const gchar *section_name; const gchar *section_name;
elf_getshdrstrndx (elf, &shstrndx); ret = elf_getshdrstrndx (elf, &shstrndx);
g_assert (shstrndx >= 0); g_assert (ret == 0);
elf_getshdrnum (elf, &shnum); ret = elf_getshdrnum (elf, &shnum);
g_assert (shnum >= 0); g_assert (ret == 0);
for (scnidx = 1; scnidx < shnum; scnidx++) for (scnidx = 1; scnidx < shnum; scnidx++)
{ {