gtk.cfg: Add some missing g_str*() functions found by daca@home

This commit is contained in:
versat 2019-10-08 10:01:17 +02:00
parent 4eb4762d95
commit 93e9e12aa1
2 changed files with 60 additions and 0 deletions

View File

@ -177,6 +177,7 @@
<define name="g_array_index(a,t,i)" value="(((t*) (void *) (a)-&gt;data) [(i)])"/>
<define name="g_ptr_array_index(array,index_)" value="((array)-&gt;pdata)[index_]"/>
<define name="g_slist_next(slist)" value="((slist) ? (((GSList *)(slist))-&gt;next) : NULL)"/>
<define name="g_strstrip(string)" value="g_strchomp (g_strchug (string))"/>
<memory>
<alloc init="true">g_thread_new</alloc>
<alloc init="true">g_thread_try_new</alloc>
@ -3631,13 +3632,27 @@
<not-bool/>
</arg>
</function>
<!-- gchar * g_strchomp (gchar *string); -->
<function name="g_strchomp">
<leak-ignore/>
<noreturn>false</noreturn>
<returnValue type="gchar *">arg1</returnValue>
<arg nr="1" direction="inout">
<not-uninit/>
<not-bool/>
<strz/>
</arg>
</function>
<!-- gchar * g_strchug (gchar *string); -->
<function name="g_strchug">
<leak-ignore/>
<noreturn>false</noreturn>
<returnValue type="gchar *">arg1</returnValue>
<arg nr="1" direction="inout">
<not-uninit/>
<not-bool/>
<strz/>
</arg>
</function>
<!-- int g_strcmp0 (const char *str1, const char *str2); -->
<function name="g_strcmp0">
@ -3753,6 +3768,20 @@
<valid>0:</valid>
</arg>
</function>
<!-- gchar * g_strndup (const gchar *str, gsize n); -->
<function name="g_strndup">
<noreturn>false</noreturn>
<returnValue type="gchar *"/>
<use-retval/>
<arg nr="1" direction="in">
<not-uninit/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
</function>
<function name="g_strreverse">
<leak-ignore/>
<noreturn>false</noreturn>
@ -3769,6 +3798,24 @@
<leak-ignore/>
<noreturn>false</noreturn>
</function>
<!-- gchar ** g_strsplit (const gchar *string, const gchar *delimiter, gint max_tokens); -->
<function name="g_strsplit">
<noreturn>false</noreturn>
<returnValue type="gchar **"/>
<use-retval/>
<arg nr="1" direction="in">
<not-uninit/>
<strz/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
<strz/>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
<not-bool/>
</arg>
</function>
<function name="g_strstr_len">
<leak-ignore/>
<noreturn>false</noreturn>

View File

@ -401,3 +401,16 @@ void g_once_init_enter_leave_test()
g_once_init_leave(init_val4, 1);
}
}
void g_strchug_g_strchomp_test(gchar * str1)
{
g_strchug(str1);
g_strchomp(str1);
g_strchug(g_strchomp(str1));
gchar * str2;
// cppcheck-suppress uninitvar
g_strchug(str2);
gchar * str3;
// cppcheck-suppress uninitvar
g_strchomp(str3);
}