New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix arm-none-eabi build (fixes #451) #496
Conversation
This makes vitasdk package builder CI work also: vitasdk/packages#28 |
@@ -279,10 +279,9 @@ hb_ot_layout_get_ligature_carets (hb_font_t *font, | |||
hb_codepoint_t glyph, | |||
unsigned int start_offset, | |||
unsigned int *caret_count /* IN/OUT */, | |||
int *caret_array /* OUT */) | |||
hb_position_t *caret_array /* OUT */) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it matches with its actual signature on src/hb-ot-layout.h
src/hb-ot-font.cc
Outdated
@@ -44,7 +44,7 @@ | |||
struct hb_ot_face_metrics_accelerator_t | |||
{ | |||
unsigned int num_metrics; | |||
unsigned int num_advances; | |||
uint32_t num_advances; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be safe I'd guess AFAIK but have a careful look please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needed as https://github.com/behdad/harfbuzz/blob/79e8e27ffd3da29ca27d3aebd2ef425bf1cb7f9d/src/hb-ot-font.cc#L141 glyph is uint32_t so this should be also (or I should cast there instead)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meh. This case, cast would have been nice. But doesn't matter. Maybe change num_metrics
to uint32_t as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
np, went for cast
@@ -671,6 +671,30 @@ parse_uint (const char **pp, const char *end, unsigned int *pv) | |||
} | |||
|
|||
static bool | |||
parse_uint32 (const char **pp, const char *end, uint32_t *pv) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplication of parse_uint, no template please as it opens another can of worms on different platforms I'd think :)
@@ -139,28 +139,28 @@ joining_type (hb_codepoint_t u) | |||
switch (u >> 12) | |||
{ | |||
case 0x0u: | |||
if (hb_in_range (u, 0x0600u, 0x08E2u)) return joining_table[u - 0x0600u + joining_offset_0x0600u]; | |||
if (hb_in_range<hb_codepoint_t> (u, 0x0600u, 0x08E2u)) return joining_table[u - 0x0600u + joining_offset_0x0600u]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I change 0x0600u to 0x0600uL it works on arm-none-eabi but not on my default build system, so best way here would be disambiguating it I'd guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another option would be to define a macro U:
#define U(v) ((hb_codepoint_t) (v))
and then use `U(0x0600)` etc. Or even further, dropping the 0x, so we can say eg. `u(0600)`. But we can do that in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was doing this but found out U already has a conflicting use.
Not in favor of u() personally as it will obfuscating things more on my view, lets defer it if is possible.
Template disambiguating had before use on the project so they are not that unusual I'd guess
src/hb-common.cc
Outdated
bool had_value = parse_uint (pp, end, &feature->value) || | ||
parse_bool (pp, end, &feature->value); | ||
bool had_value = parse_uint (pp, end, (unsigned int*) &feature->value) || | ||
parse_bool (pp, end, (unsigned int*) &feature->value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another option would be to define a local variable of appropriate type, and assign that to feature->value
later. Then you wouldn't need duplicating parse_uint
and parse_bool
etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On that case I should interfere more with the logic as putting result on the OUT parameter is not happening always so I should check one first then the other ... let defer that.
As we discussed yesterday, the |
@@ -138,7 +138,7 @@ struct hb_ot_face_metrics_accelerator_t | |||
return this->default_advance; | |||
} | |||
|
|||
return this->table->longMetric[MIN (glyph, this->num_advances - 1)].advance | |||
return this->table->longMetric[MIN (glyph, (uint32_t) this->num_advances - 1)].advance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As requested instead interfering with "num_advances" type
@@ -128,7 +128,7 @@ set(HB_VERSION_MICRO ${CMAKE_MATCH_4}) | |||
|
|||
## Define ragel tasks | |||
if (NOT IN_HB_DIST) | |||
find_program(RAGEL "ragel") | |||
find_program(RAGEL "ragel" CMAKE_FIND_ROOT_PATH_BOTH) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it can find ragel on vitasdk environment.
@@ -71,7 +71,7 @@ endif () | |||
|
|||
## Detect if we are running inside a distribution or regular repository folder | |||
set(IN_HB_DIST FALSE) | |||
if (EXISTS "${PROJECT_SOURCE_DIR}/src/hb-version.h") | |||
if (EXISTS "${PROJECT_SOURCE_DIR}/ChangeLog") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better is-in-distribution check
Thanks. Please merge as you see fit (and if the bots are green). |
This Is a part of porting harfbuz to vitasdk, I guess "src/hb-ot-layout.cc" change part, specially, needs more careful reviewing.