[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2-demos] master 2c5abddf 2/2: Fix various minor compiler warnin
From: |
Werner Lemberg |
Subject: |
[freetype2-demos] master 2c5abddf 2/2: Fix various minor compiler warnings. |
Date: |
Wed, 8 Feb 2023 16:01:50 -0500 (EST) |
branch: master
commit 2c5abddf231b5561d75207b53e707dd18f58a9f5
Author: Werner Lemberg <wl@gnu.org>
Commit: Werner Lemberg <wl@gnu.org>
Fix various minor compiler warnings.
---
graph/gblany.h | 4 ++--
graph/gblender.c | 2 +-
graph/grfont.c | 4 ++--
src/ftbench.c | 2 +-
src/ftcommon.c | 8 ++++----
src/ftmulti.c | 2 +-
src/ftstring.c | 6 +++---
7 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/graph/gblany.h b/graph/gblany.h
index 23a913df..93226477 100644
--- a/graph/gblany.h
+++ b/graph/gblany.h
@@ -398,12 +398,12 @@ static void
GCONCAT( _gblender_blit_bgra_, GDST_TYPE )( GBlenderBlit blit,
grColor color )
{
- (void)color; /* unused */
-
int h = blit->height;
const unsigned char* src_line = blit->src_line + blit->src_x*4;
unsigned char* dst_line = blit->dst_line + blit->dst_x*GDST_INCR;
+ (void)color; /* unused */
+
do
{
const unsigned char* src = src_line;
diff --git a/graph/gblender.c b/graph/gblender.c
index a34d7324..64407fa7 100644
--- a/graph/gblender.c
+++ b/graph/gblender.c
@@ -261,7 +261,7 @@ gblender_reset_key( GBlender blender,
(*gr)[1] = g;
(*gr)[2] = b;
#else
- gr[0] = ( r << 16 ) | ( g << 8 ) | b;
+ gr[0] = (GBlenderCell)( ( r << 16 ) | ( g << 8 ) | b );
#endif
gr++;
}
diff --git a/graph/grfont.c b/graph/grfont.c
index 0482cc33..6aed6144 100644
--- a/graph/grfont.c
+++ b/graph/grfont.c
@@ -8,7 +8,7 @@
/* internal CP437 8x8 font characters */
- const unsigned char font_8x8[2048] =
+ static const unsigned char font_8x8[2048] =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7E, 0x81, 0xA5, 0x81, 0xBD, 0x99, 0x81, 0x7E,
@@ -274,7 +274,7 @@
/* internal CP437 8x14 font characters */
- const unsigned char font_8x14[3584] =
+ static const unsigned char font_8x14[3584] =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00,
0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0x81, 0xbd, 0x99, 0x81, 0x7e, 0x00,
0x00, 0x00,
diff --git a/src/ftbench.c b/src/ftbench.c
index 9f785cb6..81fcb64f 100644
--- a/src/ftbench.c
+++ b/src/ftbench.c
@@ -1333,7 +1333,7 @@
/* sync target and mode */
load_flags |= FT_LOAD_TARGET_( render_mode );
- render_mode = ( load_flags & 0xF0000 ) >> 16;
+ render_mode = (FT_Render_Mode)( ( load_flags & 0xF0000 ) >> 16 );
header( face );
diff --git a/src/ftcommon.c b/src/ftcommon.c
index d0bf106d..b8ba2eac 100644
--- a/src/ftcommon.c
+++ b/src/ftcommon.c
@@ -311,7 +311,7 @@
if ( has_extension )
{
/* Ignore `.t1' `.pfa',`.pfb' extension in the original path. */
- path_len = suffix - font->filepathname;
+ path_len = (size_t)( suffix - font->filepathname );
}
ext_path_len = path_len + 5; /* 4 bytes extension + '\0' */
@@ -502,7 +502,7 @@
FT_Outline FT = { sizeof ( c ) / sizeof ( c[0] ),
sizeof ( p ) / sizeof ( p[0] ),
p, t, c, FT_OUTLINE_NONE };
- grBitmap icon = { 0 };
+ grBitmap icon = { 0, 0, 0, gr_pixel_mode_none, 0, NULL };
grBitmap* picon = NULL;
int size, i;
@@ -599,7 +599,7 @@
font->face_index = ( j << 16 ) + i;
- if ( handle->encoding < face->num_charmaps )
+ if ( handle->encoding < (unsigned long)face->num_charmaps )
font->cmap_index = handle->encoding;
else if ( handle->encoding != FT_ENCODING_ORDER &&
!FT_Select_Charmap( face, (FT_Encoding)handle->encoding ) )
@@ -2036,7 +2036,7 @@
for ( i = 0; i < 4 && s[i]; i++ )
- l = ( l << 8 ) | s[i];
+ l = ( l << 8 ) | (unsigned char)s[i];
/* interpret numerically if too short for a tag */
if ( i < 4 && !sscanf( s, "%lu", &l ) )
diff --git a/src/ftmulti.c b/src/ftmulti.c
index c2592110..91eaa2b4 100644
--- a/src/ftmulti.c
+++ b/src/ftmulti.c
@@ -1198,7 +1198,7 @@
multimaster->axis[axis].name,
hidden[axis] ? "*" : "",
design_pos[axis] / 65536.0 );
- grWriteCellString( bit, 0, ( n + 4 ) * HEADER_HEIGHT,
+ grWriteCellString( bit, 0, (int)( n + 4 ) * HEADER_HEIGHT,
Header, fore_color );
}
diff --git a/src/ftstring.c b/src/ftstring.c
index 9029a1ac..55a2b042 100644
--- a/src/ftstring.c
+++ b/src/ftstring.c
@@ -485,7 +485,7 @@
else if ( 31 < key && key < 127 )
{
if ( cursor < 31)
- buffer[cursor++] = key;
+ buffer[cursor++] = (char)key;
}
else if ( key != grKeyTab )
return 0;
@@ -918,11 +918,11 @@
while ( 1 )
{
pt_size += step;
- pt_height = handle->scaler.height;
+ pt_height = (int)handle->scaler.height;
FTDemo_Set_Current_Charsize( handle, pt_size, status.res );
/* avoid reloading repetitive sizes with bitmap fonts */
- if ( handle->scaler.height != pt_height )
+ if ( (int)handle->scaler.height != pt_height )
FTDemo_String_Load( handle, &sc );
error = FTDemo_Get_Size( handle, &size );
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2-demos] master 2c5abddf 2/2: Fix various minor compiler warnings.,
Werner Lemberg <=