mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-03-29 21:50:41 +02:00
Merge branch 'fixes' into 'master'
Draft: Fix warnings See merge request cairo/cairo!656
This commit is contained in:
commit
7edf2861ed
26 changed files with 102 additions and 107 deletions
|
|
@ -125,7 +125,7 @@ _cairo_boilerplate_win32_create_ddb_surface (const char *name,
|
|||
if (pixel_bits <= 8) {
|
||||
assert (pixel_bits == 8);
|
||||
|
||||
for (BYTE i = 0; i <= 255; i++) {
|
||||
for (int i = 0; i < 256; i++) {
|
||||
bitmap_desc.color_table[i].rgbBlue = i;
|
||||
bitmap_desc.color_table[i].rgbGreen = i;
|
||||
bitmap_desc.color_table[i].rgbRed = i;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
#ifdef HAVE_SYS_STAT_H
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
#ifdef HAVE_IO_H
|
||||
#include <io.h>
|
||||
#ifdef _WIN32
|
||||
#define _CRT_NONSTDC_NO_WARNINGS
|
||||
#include <direct.h>
|
||||
#endif
|
||||
|
||||
int main(int ac, char **av)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
#ifdef HAVE_SYS_STAT_H
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
#ifdef HAVE_IO_H
|
||||
#include <io.h>
|
||||
#ifdef _WIN32
|
||||
#define _CRT_NONSTDC_NO_WARNINGS
|
||||
#include <direct.h>
|
||||
#endif
|
||||
|
||||
int main(int ac, char **av)
|
||||
|
|
|
|||
26
meson.build
26
meson.build
|
|
@ -44,7 +44,6 @@ cflags = []
|
|||
if cc.get_id() != 'msvc'
|
||||
cflags += [
|
||||
'-Wmissing-declarations',
|
||||
'-Werror-implicit-function-declaration',
|
||||
'-Wpointer-arith',
|
||||
'-Wwrite-strings',
|
||||
'-Wsign-compare',
|
||||
|
|
@ -90,15 +89,22 @@ if cc.get_id() != 'msvc'
|
|||
conf.set('WARN_UNUSED_RESULT', warn_unused_result)
|
||||
endif
|
||||
|
||||
if cc.get_id() == 'msvc'
|
||||
if cc.get_argument_syntax() == 'msvc'
|
||||
# Basic usage in the cairo type system that causes spammy and useless warnings
|
||||
add_project_arguments('/wd4244', '/wd4146',
|
||||
# Don't warn about double -> float truncation
|
||||
'/wd4305',
|
||||
# Don't warn about size_t -> smaller integral truncation
|
||||
'/wd4267',
|
||||
# Don't warn about _cairo_status -> _cairo_int_status conversion
|
||||
'/wd5286',
|
||||
# Turn "<function> undefined, assuming extern returning int" to an error
|
||||
'/we4013',
|
||||
language : ['c', 'cpp'])
|
||||
add_project_arguments('-D_CRT_SECURE_NO_WARNINGS', language : ['c', 'cpp'])
|
||||
add_project_arguments(['-D_CRT_SECURE_NO_WARNINGS',
|
||||
'-D_CRT_NONSTDC_NO_WARNINGS',
|
||||
'-D_USE_MATH_DEFINES',
|
||||
], language : ['c', 'cpp'])
|
||||
endif
|
||||
|
||||
add_project_arguments('-D_GNU_SOURCE', language: ['c', 'cpp'])
|
||||
|
|
@ -136,7 +142,6 @@ check_headers = [
|
|||
['fenv.h'],
|
||||
['sys/wait.h'],
|
||||
['sys/stat.h'],
|
||||
['io.h'],
|
||||
['fenv.h', {'check-funcs': ['feenableexcept', 'fedisableexcept', 'feclearexcept']}],
|
||||
['xlocale.h'],
|
||||
['sys/ioctl.h'],
|
||||
|
|
@ -148,9 +153,13 @@ check_headers = [
|
|||
check_types = [
|
||||
['uint64_t', {'headers': ['stdint.h']}],
|
||||
['uint128_t', {'headers': ['stdint.h']}],
|
||||
['__uint128_t']
|
||||
]
|
||||
|
||||
# https://github.com/llvm/llvm-project/issues/25679
|
||||
if cc.get_id() != 'clang-cl'
|
||||
check_types += [ ['__uint128_t'] ]
|
||||
endif
|
||||
|
||||
check_funcs = [
|
||||
'alarm',
|
||||
'ctime_r',
|
||||
|
|
@ -670,6 +679,9 @@ if pixman_dep.found()
|
|||
if pixman_dep.version().version_compare('>= 0.42.3')
|
||||
conf.set('HAS_PIXMAN_r8g8b8_sRGB', 1)
|
||||
endif
|
||||
if pixman_dep.version().version_compare('>= 0.46.0')
|
||||
conf.set('HAS_PIXMAN_a16b16g16r16', 1)
|
||||
endif
|
||||
if pixman_dep.type_name() == 'internal'
|
||||
internal_deps += [pixman_dep]
|
||||
else
|
||||
|
|
@ -785,10 +797,6 @@ if conf.get('HAVE_SYS_STAT_H', 0) == 1
|
|||
test_mkdir_c_args += ['-DHAVE_SYS_STAT_H']
|
||||
endif
|
||||
|
||||
if conf.get('HAVE_IO_H', 0) == 1
|
||||
test_mkdir_c_args += ['-DHAVE_IO_H']
|
||||
endif
|
||||
|
||||
if cc.links(files('meson-cc-tests/mkdir-variant-1.c'), args: test_mkdir_c_args)
|
||||
conf.set('HAVE_MKDIR', 1)
|
||||
elif cc.links(files('meson-cc-tests/mkdir-variant-2.c'), args: test_mkdir_c_args)
|
||||
|
|
|
|||
|
|
@ -50,6 +50,10 @@
|
|||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include "dirent-win32.h"
|
||||
|
||||
|
|
@ -381,16 +385,12 @@ cairo_perf_fini (cairo_perf_t *perf)
|
|||
static cairo_bool_t
|
||||
have_trace_filenames (cairo_perf_t *perf)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
if (perf->num_names == 0)
|
||||
return FALSE;
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
for (i = 0; i < perf->num_names; i++)
|
||||
for (unsigned int i = 0; i < perf->num_names; i++)
|
||||
if (access (perf->names[i], R_OK) == 0)
|
||||
return TRUE;
|
||||
#endif
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,6 +51,10 @@
|
|||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include "dirent-win32.h"
|
||||
|
||||
|
|
@ -549,16 +553,12 @@ cairo_perf_fini (cairo_perf_t *perf)
|
|||
static cairo_bool_t
|
||||
have_trace_filenames (cairo_perf_t *perf)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
if (perf->num_names == 0)
|
||||
return FALSE;
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
for (i = 0; i < perf->num_names; i++)
|
||||
for (unsigned int i = 0; i < perf->num_names; i++)
|
||||
if (access (perf->names[i], R_OK) == 0)
|
||||
return TRUE;
|
||||
#endif
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
*/
|
||||
|
||||
#include "cairo-perf.h"
|
||||
#define _USE_MATH_DEFINES /* for M_SQRT2 on win32 */
|
||||
|
||||
#include <math.h>
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ typedef struct _cairo_base64_stream {
|
|||
unsigned char src[3];
|
||||
} cairo_base64_stream_t;
|
||||
|
||||
static char const base64_table[64] =
|
||||
static char const cairo_nonstring base64_table[64] =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
|
||||
static cairo_status_t
|
||||
|
|
|
|||
|
|
@ -1095,8 +1095,6 @@ draw_paint (cairo_colr_glyph_render_t *render,
|
|||
FT_Vector orig_delta;
|
||||
cairo_status_t status = CAIRO_STATUS_SUCCESS;
|
||||
|
||||
assert (cairo_status (cr) == CAIRO_STATUS_SUCCESS);
|
||||
|
||||
if (!FT_Get_Paint (render->face, *paint, &p))
|
||||
return CAIRO_STATUS_NO_MEMORY;
|
||||
|
||||
|
|
|
|||
|
|
@ -148,26 +148,23 @@
|
|||
#define unlikely(expr) (expr)
|
||||
#endif
|
||||
|
||||
#if defined (__GNUC__)
|
||||
#define cairo_nonstring __attribute__((nonstring))
|
||||
#else
|
||||
#define cairo_nonstring
|
||||
#endif
|
||||
|
||||
#if !defined(__GNUC__) && !defined (__clang__)
|
||||
#undef __attribute__
|
||||
#define __attribute__(x)
|
||||
#endif
|
||||
|
||||
#if (defined(__WIN32__) && !defined(__WINE__)) || defined(_MSC_VER)
|
||||
#define access _access
|
||||
#ifndef R_OK
|
||||
#define R_OK 4
|
||||
#endif
|
||||
#define fdopen _fdopen
|
||||
#define hypot _hypot
|
||||
#define pclose _pclose
|
||||
#define popen _popen
|
||||
#define strdup _strdup
|
||||
#define unlink _unlink
|
||||
#if defined (_MSC_VER) && _MSC_VER < 1900
|
||||
#define vsnprintf _vsnprintf
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && defined(_M_IX86)
|
||||
|
|
|
|||
|
|
@ -113,6 +113,9 @@ _cairo_format_from_pixman_format (pixman_format_code_t pixman_format)
|
|||
case PIXMAN_a8r8g8b8_sRGB:
|
||||
#if HAS_PIXMAN_r8g8b8_sRGB
|
||||
case PIXMAN_r8g8b8_sRGB:
|
||||
#endif
|
||||
#if HAS_PIXMAN_a16b16g16r16
|
||||
case PIXMAN_a16b16g16r16:
|
||||
#endif
|
||||
case PIXMAN_a8b8g8r8: case PIXMAN_x8b8g8r8: case PIXMAN_r8g8b8:
|
||||
case PIXMAN_b8g8r8: case PIXMAN_b5g6r5:
|
||||
|
|
|
|||
|
|
@ -1885,7 +1885,7 @@ typedef struct {
|
|||
unsigned char src[3];
|
||||
} base64_write_closure_t;
|
||||
|
||||
static char const base64_table[64] =
|
||||
static char const cairo_nonstring base64_table[64] =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
|
||||
static cairo_status_t
|
||||
|
|
|
|||
|
|
@ -492,7 +492,7 @@ cairo_type1_font_write_header (cairo_type1_font_t *font,
|
|||
const char *name)
|
||||
{
|
||||
unsigned int i;
|
||||
const char spaces[50] = " ";
|
||||
const char cairo_nonstring spaces[50] = " ";
|
||||
|
||||
_cairo_output_stream_printf (font->output,
|
||||
"%%!FontType1-1.1 %s 1.0\n"
|
||||
|
|
@ -555,7 +555,7 @@ cairo_type1_write_stream_encrypted (void *closure,
|
|||
{
|
||||
const unsigned char *in, *end;
|
||||
uint16_t c, p;
|
||||
static const char hex_digits[16] = "0123456789abcdef";
|
||||
static const char cairo_nonstring hex_digits[16] = "0123456789abcdef";
|
||||
char digits[3];
|
||||
cairo_type1_font_t *font = closure;
|
||||
|
||||
|
|
@ -642,7 +642,7 @@ static void
|
|||
cairo_type1_font_write_trailer(cairo_type1_font_t *font)
|
||||
{
|
||||
int i;
|
||||
static const char zeros[65] =
|
||||
static const char cairo_nonstring zeros[65] =
|
||||
"0000000000000000000000000000000000000000000000000000000000000000\n";
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
|
|
|
|||
|
|
@ -606,7 +606,7 @@ cairo_type1_font_subset_write_encrypted (cairo_type1_font_subset_t *font,
|
|||
{
|
||||
const unsigned char *in, *end;
|
||||
int c, p;
|
||||
static const char hex_digits[16] = "0123456789abcdef";
|
||||
static const char cairo_nonstring hex_digits[16] = "0123456789abcdef";
|
||||
char digits[3];
|
||||
|
||||
in = (const unsigned char *) data;
|
||||
|
|
@ -1543,7 +1543,7 @@ cairo_type1_font_subset_write_trailer(cairo_type1_font_subset_t *font)
|
|||
{
|
||||
const char *cleartomark_token;
|
||||
int i;
|
||||
static const char zeros[65] =
|
||||
static const char cairo_nonstring zeros[65] =
|
||||
"0000000000000000000000000000000000000000000000000000000000000000\n";
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -55,9 +55,6 @@
|
|||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define _USE_MATH_DEFINES
|
||||
#endif
|
||||
#include <math.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
|
|
@ -143,7 +140,10 @@ CAIRO_BEGIN_DECLS
|
|||
#define ASSERT_NOT_REACHED \
|
||||
do { \
|
||||
assert (!"reached"); \
|
||||
abort (); \
|
||||
} while (0)
|
||||
|
||||
|
||||
#define COMPILE_TIME_ASSERT1(condition, line) \
|
||||
typedef int compile_time_assertion_at_line_##line##_failed [(condition)?1:-1]
|
||||
#define COMPILE_TIME_ASSERT0(condition, line) COMPILE_TIME_ASSERT1(condition, line)
|
||||
|
|
@ -178,7 +178,7 @@ _cairo_popcount (uint32_t mask)
|
|||
#if defined (__GNUC__)
|
||||
return __builtin_popcount (mask);
|
||||
#else
|
||||
register int y;
|
||||
int y;
|
||||
|
||||
y = (mask >> 1) &033333333333;
|
||||
y = mask - y - ((y >>1) & 033333333333);
|
||||
|
|
|
|||
|
|
@ -256,6 +256,10 @@ _create_rendering_params(IDWriteRenderingParams *params,
|
|||
modified = TRUE;
|
||||
}
|
||||
break;
|
||||
case CAIRO_ANTIALIAS_BEST:
|
||||
case CAIRO_ANTIALIAS_GOOD:
|
||||
case CAIRO_ANTIALIAS_SUBPIXEL:
|
||||
case CAIRO_ANTIALIAS_DEFAULT:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -273,6 +277,9 @@ _create_rendering_params(IDWriteRenderingParams *params,
|
|||
modified = TRUE;
|
||||
}
|
||||
break;
|
||||
case CAIRO_SUBPIXEL_ORDER_DEFAULT:
|
||||
case CAIRO_SUBPIXEL_ORDER_VRGB:
|
||||
case CAIRO_SUBPIXEL_ORDER_VBGR:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -508,7 +515,7 @@ read_short(const char *buf)
|
|||
return be16_to_cpu(*(unsigned short*)buf);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
_cairo_dwrite_glyph_run_from_glyphs(cairo_glyph_t *glyphs,
|
||||
int num_glyphs,
|
||||
cairo_dwrite_scaled_font_t *scaled_font,
|
||||
|
|
|
|||
|
|
@ -248,23 +248,6 @@ _compute_transform (cairo_win32_scaled_font_t *scaled_font,
|
|||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static cairo_bool_t
|
||||
_have_cleartype_quality (void)
|
||||
{
|
||||
OSVERSIONINFO version_info;
|
||||
|
||||
version_info.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
|
||||
|
||||
if (!GetVersionEx (&version_info)) {
|
||||
_cairo_win32_print_api_error (__FUNCTION__, "GetVersionEx");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return (version_info.dwMajorVersion > 5 ||
|
||||
(version_info.dwMajorVersion == 5 &&
|
||||
version_info.dwMinorVersion >= 1)); /* XP or newer */
|
||||
}
|
||||
|
||||
BYTE
|
||||
cairo_win32_get_system_text_quality (void)
|
||||
{
|
||||
|
|
@ -277,18 +260,16 @@ cairo_win32_get_system_text_quality (void)
|
|||
}
|
||||
|
||||
if (font_smoothing) {
|
||||
if (_have_cleartype_quality ()) {
|
||||
if (!SystemParametersInfo (SPI_GETFONTSMOOTHINGTYPE,
|
||||
0, &smoothing_type, 0)) {
|
||||
_cairo_win32_print_api_error (__FUNCTION__, "SystemParametersInfo");
|
||||
return DEFAULT_QUALITY;
|
||||
}
|
||||
if (!SystemParametersInfo (SPI_GETFONTSMOOTHINGTYPE,
|
||||
0, &smoothing_type, 0)) {
|
||||
_cairo_win32_print_api_error (__FUNCTION__, "SystemParametersInfo");
|
||||
return DEFAULT_QUALITY;
|
||||
}
|
||||
|
||||
if (smoothing_type == FE_FONTSMOOTHINGCLEARTYPE)
|
||||
return CLEARTYPE_QUALITY;
|
||||
}
|
||||
if (smoothing_type == FE_FONTSMOOTHINGCLEARTYPE)
|
||||
return CLEARTYPE_QUALITY;
|
||||
|
||||
return ANTIALIASED_QUALITY;
|
||||
return ANTIALIASED_QUALITY;
|
||||
} else {
|
||||
return DEFAULT_QUALITY;
|
||||
}
|
||||
|
|
@ -346,10 +327,7 @@ _win32_scaled_font_create (LOGFONTW *logfont,
|
|||
break;
|
||||
case CAIRO_ANTIALIAS_SUBPIXEL:
|
||||
case CAIRO_ANTIALIAS_BEST:
|
||||
if (_have_cleartype_quality ())
|
||||
f->quality = CLEARTYPE_QUALITY;
|
||||
else
|
||||
f->quality = ANTIALIASED_QUALITY;
|
||||
f->quality = CLEARTYPE_QUALITY;
|
||||
break;
|
||||
case CAIRO_ANTIALIAS_DEFAULT:
|
||||
ASSERT_NOT_REACHED;
|
||||
|
|
@ -1340,7 +1318,7 @@ _cairo_win32_scaled_font_load_type1_data (void *abstract_font,
|
|||
length);
|
||||
}
|
||||
|
||||
cairo_surface_t *
|
||||
static cairo_surface_t *
|
||||
_cairo_compute_glyph_mask (cairo_surface_t *surface,
|
||||
int quality)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@
|
|||
|
||||
#include "cairoint.h"
|
||||
|
||||
#include "cairo-win32-private.h"
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -87,6 +87,10 @@
|
|||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_UNISTD_H && HAVE_SIGNAL_H && HAVE_SYS_STAT_H && HAVE_SYS_SOCKET_H && (HAVE_POLL_H || HAVE_SYS_POLL_H) && HAVE_SYS_UN_H
|
||||
#include <signal.h>
|
||||
#include <sys/stat.h>
|
||||
|
|
|
|||
|
|
@ -67,9 +67,8 @@
|
|||
#ifdef _MSC_VER
|
||||
#include <crtdbg.h>
|
||||
#include <direct.h>
|
||||
#include <io.h>
|
||||
#define F_OK 0
|
||||
#define HAVE_MKDIR 1
|
||||
#define mkdir _mkdir
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
|
|
|
|||
|
|
@ -55,13 +55,7 @@ typedef unsigned __int64 uint64_t;
|
|||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define _USE_MATH_DEFINES
|
||||
|
||||
#include <float.h>
|
||||
#if _MSC_VER <= 1600
|
||||
#define isnan(x) _isnan(x)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if HAVE_FENV_H
|
||||
|
|
|
|||
|
|
@ -41,6 +41,13 @@
|
|||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#include <cairo.h>
|
||||
|
||||
#if CAIRO_HAS_PDF_SURFACE
|
||||
|
|
|
|||
|
|
@ -139,9 +139,9 @@ _csi_array_execute (csi_t *ctx, csi_array_t *array)
|
|||
for (i = 0; i < array->stack.len; i++) {
|
||||
csi_object_t *obj = &array->stack.objects[i];
|
||||
|
||||
if (obj->type & CSI_OBJECT_ATTR_EXECUTABLE) {
|
||||
if (obj->type & (csi_object_type_t) CSI_OBJECT_ATTR_EXECUTABLE) {
|
||||
if (obj->type == (CSI_OBJECT_TYPE_ARRAY |
|
||||
CSI_OBJECT_ATTR_EXECUTABLE))
|
||||
(csi_object_type_t) CSI_OBJECT_ATTR_EXECUTABLE))
|
||||
{
|
||||
status = _csi_push_ostack_copy (ctx, &array->stack.objects[i]);
|
||||
}
|
||||
|
|
@ -618,12 +618,12 @@ csi_object_execute (csi_t *ctx, csi_object_t *obj)
|
|||
csi_object_t indirect;
|
||||
|
||||
INDIRECT:
|
||||
switch (obj->type & CSI_OBJECT_TYPE_MASK) {
|
||||
switch (obj->type & (csi_object_type_t) CSI_OBJECT_TYPE_MASK) {
|
||||
case CSI_OBJECT_TYPE_NAME:
|
||||
status = _csi_name_lookup (ctx, obj->datum.name, &indirect);
|
||||
if (_csi_unlikely (status))
|
||||
return status;
|
||||
if (indirect.type & CSI_OBJECT_ATTR_EXECUTABLE) {
|
||||
if (indirect.type & (csi_object_type_t) CSI_OBJECT_ATTR_EXECUTABLE) {
|
||||
obj = &indirect;
|
||||
goto INDIRECT;
|
||||
} else
|
||||
|
|
@ -648,7 +648,7 @@ csi_object_t *
|
|||
csi_object_reference (csi_object_t *obj)
|
||||
{
|
||||
if (CSI_OBJECT_IS_CAIRO (obj)) {
|
||||
switch (obj->type & CSI_OBJECT_TYPE_MASK) {
|
||||
switch (obj->type & (csi_object_type_t) CSI_OBJECT_TYPE_MASK) {
|
||||
case CSI_OBJECT_TYPE_CONTEXT:
|
||||
cairo_reference (obj->datum.cr);
|
||||
break;
|
||||
|
|
@ -677,7 +677,7 @@ csi_object_free (csi_t *ctx,
|
|||
csi_object_t *obj)
|
||||
{
|
||||
if (CSI_OBJECT_IS_CAIRO (obj)) {
|
||||
switch (obj->type & CSI_OBJECT_TYPE_MASK) {
|
||||
switch (obj->type & (csi_object_type_t) CSI_OBJECT_TYPE_MASK) {
|
||||
case CSI_OBJECT_TYPE_CONTEXT:
|
||||
cairo_destroy (obj->datum.cr);
|
||||
break;
|
||||
|
|
@ -698,7 +698,7 @@ csi_object_free (csi_t *ctx,
|
|||
if (--obj->datum.object->ref)
|
||||
return;
|
||||
|
||||
switch (obj->type & CSI_OBJECT_TYPE_MASK) {
|
||||
switch (obj->type & (csi_object_type_t) CSI_OBJECT_TYPE_MASK) {
|
||||
case CSI_OBJECT_TYPE_ARRAY:
|
||||
csi_array_free (ctx, obj->datum.array);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -46,11 +46,6 @@
|
|||
#include <stdlib.h> /* mkstemp */
|
||||
#include <string.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define _USE_MATH_DEFINES /* for M_LN2, M_PI and M_SQRT2 on win32 */
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
#include <limits.h> /* INT_MAX */
|
||||
#include <assert.h>
|
||||
|
|
@ -901,7 +896,7 @@ _bind_substitute (csi_t *ctx, csi_array_t *array)
|
|||
for (i = 0; i < n; i++) {
|
||||
csi_object_t *obj = &array->stack.objects[i];
|
||||
|
||||
if (obj->type == (CSI_OBJECT_TYPE_NAME | CSI_OBJECT_ATTR_EXECUTABLE)) {
|
||||
if (obj->type == (CSI_OBJECT_TYPE_NAME | (csi_object_type_t) CSI_OBJECT_ATTR_EXECUTABLE)) {
|
||||
csi_dictionary_entry_t *entry;
|
||||
|
||||
entry = _csi_hash_table_lookup (&dict->hash_table,
|
||||
|
|
@ -1926,7 +1921,6 @@ _ft_create_for_pattern (csi_t *ctx,
|
|||
cairo_font_face_t *font_face;
|
||||
FcPattern *pattern, *resolved;
|
||||
csi_status_t status;
|
||||
struct mmap_vec vec;
|
||||
void *bytes;
|
||||
|
||||
_csi_blob_init (&tmpl, (uint8_t *) string->string, string->len);
|
||||
|
|
@ -2001,7 +1995,9 @@ retry:
|
|||
data->blob.len = tmpl.len;
|
||||
data->bytes = NULL;
|
||||
data->face = NULL;
|
||||
|
||||
#ifdef HAVE_MMAP
|
||||
struct mmap_vec vec;
|
||||
vec.bytes = tmpl.bytes;
|
||||
vec.num_bytes = tmpl.len;
|
||||
data->blob.bytes = _mmap_bytes (&vec, 1);
|
||||
|
|
|
|||
|
|
@ -731,7 +731,7 @@ static inline void
|
|||
csi_operator_new (csi_object_t *obj,
|
||||
csi_operator_t op)
|
||||
{
|
||||
obj->type = CSI_OBJECT_TYPE_OPERATOR | CSI_OBJECT_ATTR_EXECUTABLE;
|
||||
obj->type = CSI_OBJECT_TYPE_OPERATOR | (csi_object_type_t) CSI_OBJECT_ATTR_EXECUTABLE;
|
||||
obj->datum.op = op;
|
||||
}
|
||||
|
||||
|
|
@ -853,13 +853,13 @@ _csi_stack_exch (csi_stack_t *stack);
|
|||
static inline csi_object_type_t
|
||||
csi_object_get_type (const csi_object_t *obj)
|
||||
{
|
||||
return obj->type & CSI_OBJECT_TYPE_MASK;
|
||||
return obj->type & (csi_object_type_t) CSI_OBJECT_TYPE_MASK;
|
||||
}
|
||||
|
||||
static inline csi_boolean_t
|
||||
csi_object_is_procedure (const csi_object_t *obj)
|
||||
{
|
||||
return obj->type == (CSI_OBJECT_TYPE_ARRAY | CSI_OBJECT_ATTR_EXECUTABLE);
|
||||
return obj->type == (CSI_OBJECT_TYPE_ARRAY | (csi_object_type_t) CSI_OBJECT_ATTR_EXECUTABLE);
|
||||
}
|
||||
|
||||
static inline csi_boolean_t
|
||||
|
|
|
|||
|
|
@ -503,7 +503,7 @@ token_end (csi_t *ctx, csi_scanner_t *scan, csi_file_t *src)
|
|||
status = csi_array_append (ctx,
|
||||
scan->build_procedure.datum.array,
|
||||
&obj);
|
||||
} else if (obj.type & CSI_OBJECT_ATTR_EXECUTABLE) {
|
||||
} else if (obj.type & (csi_object_type_t) CSI_OBJECT_ATTR_EXECUTABLE) {
|
||||
status = scan_execute (ctx, &obj);
|
||||
csi_object_free (ctx, &obj);
|
||||
} else {
|
||||
|
|
@ -1037,7 +1037,7 @@ scan_none:
|
|||
status = csi_array_append (ctx,
|
||||
scan->build_procedure.datum.array,
|
||||
&obj);
|
||||
} else if (obj.type & CSI_OBJECT_ATTR_EXECUTABLE) {
|
||||
} else if (obj.type & (csi_object_type_t) CSI_OBJECT_ATTR_EXECUTABLE) {
|
||||
status = scan_execute (ctx, &obj);
|
||||
csi_object_free (ctx, &obj);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue