mirror of
https://github.com/lexborisov/Modest
synced 2024-11-24 22:59:38 +03:00
remove htonl function
This commit is contained in:
parent
00c500f0e8
commit
3a6dbfba0f
@ -151,6 +151,8 @@ uint32_t myfont_read_u32(uint8_t** data);
|
||||
|
||||
uint32_t myfont_read_u32_as_net(uint8_t** data);
|
||||
|
||||
uint32_t myfont_htonl(uint32_t data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
@ -365,14 +365,14 @@ float myfont_metrics_glyph_offset_y(myfont_font_t *mf, unsigned long codepoint,
|
||||
|
||||
int16_t myfont_table_version_major(uint32_t version)
|
||||
{
|
||||
version = htonl(version);
|
||||
version = myfont_htonl(version);
|
||||
version >>= 16;
|
||||
return (int16_t)version;
|
||||
}
|
||||
|
||||
int16_t myfont_table_version_minor(uint32_t version)
|
||||
{
|
||||
version = htonl(version);
|
||||
version = myfont_htonl(version);
|
||||
version <<= 16;
|
||||
version >>= 16;
|
||||
return (int16_t)version;
|
||||
|
@ -56,6 +56,18 @@ int32_t myfont_read_32(uint8_t** data)
|
||||
return (int32_t)cp;
|
||||
}
|
||||
|
||||
uint32_t myfont_htonl(uint32_t data)
|
||||
{
|
||||
int cp = 0;
|
||||
|
||||
cp = data << 24;
|
||||
cp |= data << 16;
|
||||
cp |= data << 8;
|
||||
cp |= data;
|
||||
|
||||
return (uint32_t)cp;
|
||||
}
|
||||
|
||||
uint16_t myfont_read_u16(uint8_t** data)
|
||||
{
|
||||
int cp = 0;
|
||||
|
@ -151,6 +151,8 @@ uint32_t myfont_read_u32(uint8_t** data);
|
||||
|
||||
uint32_t myfont_read_u32_as_net(uint8_t** data);
|
||||
|
||||
uint32_t myfont_htonl(uint32_t data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user