File: cairo.c

package info (click to toggle)
cppcheck 2.19.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 26,688 kB
  • sloc: cpp: 272,455; python: 22,408; ansic: 8,088; sh: 1,059; makefile: 1,041; xml: 987; cs: 291
file content (26 lines) | stat: -rw-r--r-- 726 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

// Test library configuration for cairo.cfg
//
// Usage:
// $ cppcheck --check-library --library=cairo --enable=style,information --inconclusive --error-exitcode=1 --inline-suppr test/cfg/cairo.c
// =>
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
//

#include <cairo.h>

void validCode(cairo_surface_t *target)
{
    cairo_t * cairo1 = cairo_create(target);
    cairo_move_to(cairo1, 1.0, 2.0);
    cairo_line_to(cairo1, 5.0, 6.0);
    cairo_destroy(cairo1);
}

void ignoredReturnValue(cairo_surface_t *target)
{
    // cppcheck-suppress ignoredReturnValue
    cairo_create(target);
    // cppcheck-suppress ignoredReturnValue
    cairo_status_to_string(CAIRO_STATUS_READ_ERROR);
}