Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions cfg/gtk.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3285,8 +3285,7 @@
<returnValue type="gchar*"/>
<arg nr="1" direction="out">
<not-null/>
<not-uninit/>
<strz/>
<minsize type="argvalue" arg="2"/>
</arg>
<arg nr="2" direction="in">
<not-bool/>
Expand All @@ -3299,10 +3298,6 @@
<strz/>
<formatstr/>
</arg>
<arg nr="4" direction="in">
<not-bool/>
<not-uninit/>
</arg>
</function>
<!-- gboolean g_ascii_isalnum(gchar c); -->
<function name="g_ascii_isalnum">
Expand Down
17 changes: 17 additions & 0 deletions test/cfg/gtk.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,3 +655,20 @@ int g_return_val_if_reached_test(const char *s) {

return 0;
}

void g_ascii_formatd_test(double d)
{
// g_ascii_formatd() writes the buffer and formats exactly one double
gchar buf[39];
g_ascii_formatd(buf, sizeof(buf), "%.2f", d);
g_print("%s", buf);

// cppcheck-suppress invalidPrintfArgType_sint
g_ascii_formatd(buf, sizeof(buf), "%d", d);
g_print("%s", buf);

gchar small[4];
// cppcheck-suppress bufferAccessOutOfBounds
g_ascii_formatd(small, sizeof(buf), "%.2f", d);
g_print("%s", small);
}
Loading