versat 2019-02-28 15:29:37 +01:00
parent e64fc279f0
commit f6c3749015
2 changed files with 10 additions and 0 deletions

View File

@ -40,6 +40,9 @@
<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)"/>
<!-- https://github.com/GNOME/glib/blob/master/glib/galloca.h -->
<define name="g_alloca(size)" value="alloca (size)"/>
<define name="g_newa(struct_type, n_structs)" value="((struct_type*) g_alloca (sizeof (struct_type) * (gsize) (n_structs)))"/>
<memory>
<alloc init="true">g_thread_new</alloc>
<alloc init="true">g_thread_try_new</alloc>

View File

@ -70,3 +70,10 @@ void g_print_test()
// cppcheck-suppress invalidPrintfArgType_uint
g_printerr("%x", "a");
}
void g_alloca_test()
{
// cppcheck-suppress allocaCalled
char * pBuf1 = g_alloca(5);
pBuf1[0] = '\0';
}