Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
fontconfig
fontconfig
Commits
fd2ad114
Commit
fd2ad114
authored
Jan 09, 2018
by
Behdad Esfahbod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix undefined-behavior signed shifts
parent
7ac6af66
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
src/fccharset.c
src/fccharset.c
+3
-3
src/fcfreetype.c
src/fcfreetype.c
+2
-2
src/ftglue.h
src/ftglue.h
+6
-6
No files found.
src/fccharset.c
View file @
fd2ad114
...
...
@@ -274,7 +274,7 @@ FcCharSetAddChar (FcCharSet *fcs, FcChar32 ucs4)
if
(
!
leaf
)
return
FcFalse
;
b
=
&
leaf
->
map
[(
ucs4
&
0xff
)
>>
5
];
*
b
|=
(
1
<<
(
ucs4
&
0x1f
));
*
b
|=
(
1
U
<<
(
ucs4
&
0x1f
));
return
FcTrue
;
}
...
...
@@ -290,7 +290,7 @@ FcCharSetDelChar (FcCharSet *fcs, FcChar32 ucs4)
if
(
!
leaf
)
return
FcTrue
;
b
=
&
leaf
->
map
[(
ucs4
&
0xff
)
>>
5
];
*
b
&=
~
(
1
<<
(
ucs4
&
0x1f
));
*
b
&=
~
(
1
U
<<
(
ucs4
&
0x1f
));
/* We don't bother removing the leaf if it's empty */
return
FcTrue
;
}
...
...
@@ -594,7 +594,7 @@ FcCharSetHasChar (const FcCharSet *fcs, FcChar32 ucs4)
leaf
=
FcCharSetFindLeaf
(
fcs
,
ucs4
);
if
(
!
leaf
)
return
FcFalse
;
return
(
leaf
->
map
[(
ucs4
&
0xff
)
>>
5
]
&
(
1
<<
(
ucs4
&
0x1f
)))
!=
0
;
return
(
leaf
->
map
[(
ucs4
&
0xff
)
>>
5
]
&
(
1
U
<<
(
ucs4
&
0x1f
)))
!=
0
;
}
static
FcChar32
...
...
src/fcfreetype.c
View file @
fd2ad114
...
...
@@ -1670,7 +1670,7 @@ FcFreeTypeQueryFaceInternal (const FT_Face face,
bits
=
os2
->
ulCodePageRange2
;
bit
=
FcCodePageRange
[
i
].
bit
-
32
;
}
if
(
bits
&
(
1
<<
bit
))
if
(
bits
&
(
1
U
<<
bit
))
{
/*
* If the font advertises support for multiple
...
...
@@ -2378,7 +2378,7 @@ FcFreeTypeCharSet (FT_Face face, FcBlanks *blanks FC_UNUSED)
goto
bail
;
}
off
=
ucs4
&
0xff
;
leaf
->
map
[
off
>>
5
]
|=
(
1
<<
(
off
&
0x1f
));
leaf
->
map
[
off
>>
5
]
|=
(
1
U
<<
(
off
&
0x1f
));
}
ucs4
=
FT_Get_Next_Char
(
face
,
ucs4
,
&
glyph
);
...
...
src/ftglue.h
View file @
fd2ad114
...
...
@@ -69,14 +69,14 @@ FT_BEGIN_HEADER
#define GET_Byte() (*stream->cursor++)
#define GET_Short() (stream->cursor += 2, (FT_Short)( \
(*(((FT_Byte*)stream->cursor)-2) << 8) | \
*(((FT_Byte*)stream->cursor)-1) \
(
(FT_ULong)
*(((FT_Byte*)stream->cursor)-2) << 8) | \
(FT_ULong)
*(((FT_Byte*)stream->cursor)-1) \
))
#define GET_Long() (stream->cursor += 4, (FT_Long)( \
(*(((FT_Byte*)stream->cursor)-4) << 24) | \
(*(((FT_Byte*)stream->cursor)-3) << 16) | \
(*(((FT_Byte*)stream->cursor)-2) << 8) | \
*(((FT_Byte*)stream->cursor)-1) \
(
(FT_ULong)
*(((FT_Byte*)stream->cursor)-4) << 24) | \
(
(FT_ULong)
*(((FT_Byte*)stream->cursor)-3) << 16) | \
(
(FT_ULong)
*(((FT_Byte*)stream->cursor)-2) << 8) | \
(FT_ULong)
*(((FT_Byte*)stream->cursor)-1) \
))
#define GET_Char() ((FT_Char)GET_Byte())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment