gtk.cfg: Add some configurations often reported as missing by daca@home
Add two g_assert*(), g_signal_connect_data(), some g_signal_connect*() functions and macros and g_strdup_printf().
This commit is contained in:
parent
59433229a0
commit
ed25ae3acb
40
cfg/gtk.cfg
40
cfg/gtk.cfg
|
@ -16,6 +16,11 @@
|
|||
<define name="N_(string)" value="(string)"/>
|
||||
<define name="C_(context, string)" value="g_dpgettext (NULL, context "\004" string, strlen (context) + 1)"/>
|
||||
<define name="NC_(context, string)" value="(string)"/>
|
||||
<define name="g_assert(expr)" value="assert(expr)"/>
|
||||
<define name="g_assert_not_reached()" value="assert(NULL)"/>
|
||||
<define name="g_signal_connect(instance, detailed_signal, c_handler, data)" value="g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, (GConnectFlags) 0)"/>
|
||||
<define name="g_signal_connect_after(instance, detailed_signal, c_handler, data)" value="g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, G_CONNECT_AFTER)"/>
|
||||
<define name="g_signal_connect_swapped(instance, detailed_signal, c_handler, data)" value="g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, G_CONNECT_SWAPPED)"/>
|
||||
<memory>
|
||||
<alloc init="true">g_thread_new</alloc>
|
||||
<alloc init="true">g_thread_try_new</alloc>
|
||||
|
@ -18095,6 +18100,41 @@
|
|||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- gchar * g_strdup_printf (const gchar *format, ...); -->
|
||||
<function name="g_strdup_printf">
|
||||
<noreturn>false</noreturn>
|
||||
<returnValue type="gchar *"/>
|
||||
<formatstr/>
|
||||
<arg nr="1">
|
||||
<formatstr/>
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- gulong g_signal_connect_data (gpointer instance, const gchar *detailed_signal,
|
||||
GCallback c_handler, gpointer data,
|
||||
GClosureNotify destroy_data, GConnectFlags connect_flags); -->
|
||||
<function name="g_signal_connect_data">
|
||||
<noreturn>false</noreturn>
|
||||
<returnValue type="gulong"/>
|
||||
<arg nr="1">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
<arg nr="2">
|
||||
<strz/>
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
<arg nr="3">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
<arg nr="4"/>
|
||||
<arg nr="5"/>
|
||||
<arg nr="6">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<define name="gchar" value="char"/>
|
||||
<define name="guchar" value="unsigned char"/>
|
||||
<define name="gint" value="int"/>
|
||||
|
|
|
@ -27,6 +27,11 @@ void validCode(int argInt)
|
|||
gpointer gpt = g_malloc(4);
|
||||
printf("%p", gpt);
|
||||
g_free(gpt);
|
||||
g_assert(gpt);
|
||||
if (!gpt) {
|
||||
// cppcheck-suppress checkLibraryNoReturn
|
||||
g_assert_not_reached();
|
||||
}
|
||||
}
|
||||
|
||||
void g_malloc_test()
|
||||
|
@ -39,3 +44,11 @@ void g_malloc_test()
|
|||
|
||||
// cppcheck-suppress memleak
|
||||
}
|
||||
|
||||
void g_assert_test()
|
||||
{
|
||||
int a;
|
||||
// cppcheck-suppress checkLibraryNoReturn
|
||||
// cppcheck-suppress assignmentInAssert
|
||||
g_assert(a = 5);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue