Skip to content

Commit

Permalink
fix 32-bit build
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzysztof Kowalczyk committed Jan 2, 2024
1 parent a73ec87 commit 9769d6a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion ext/mupdf_load_system_font.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ static void extend_system_font_list(fz_context* ctx, const WCHAR* path) {

// cf. https://blogs.msdn.com/b/oldnewthing/archive/2004/10/25/247180.aspx
EXTERN_C IMAGE_DOS_HEADER __ImageBase;
#define CURRENT_HMODULE ((HMODULE)&__ImageBase)
#define CURRENT_HMODULE ((HMODULE) & __ImageBase)

static void create_system_font_list(fz_context* ctx) {
WCHAR szFontDir[MAX_PATH];
Expand Down
8 changes: 4 additions & 4 deletions src/Menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1006,15 +1006,15 @@ static bool __cmdIdInList(UINT_PTR cmdId, UINT_PTR* idsList, int n) {
// shorten a string to maxLen characters, adding ellipsis in the middle
// ascii version that doesn't handle UTF-8
static TempStr ShortenStringTemp(char* s, int maxLen) {
size_t sLen = str::Len(s);
int sLen = (int)str::Len(s);
if (sLen <= maxLen) {
return s;
}
char* ret = AllocArrayTemp<char>(maxLen + 2);
const size_t half = maxLen / 2;
const size_t strSize = sLen + 1; // +1 for terminating \0
const int half = maxLen / 2;
const int strSize = sLen + 1; // +1 for terminating \0
// copy first N/2 characters, move last N/2 characters to the halfway point
for (size_t i = 0; i < half; i++) {
for (int i = 0; i < half; i++) {
ret[i] = s[i];
ret[i + half] = s[strSize - half + i];
}
Expand Down
14 changes: 7 additions & 7 deletions src/utils/windrawlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
*/
typedef DWORD WD_COLOR;

#define WD_ARGB(a, r, g, b) \
((((WD_COLOR)(a)&0xff) << 24) | (((WD_COLOR)(r)&0xff) << 16) | (((WD_COLOR)(g)&0xff) << 8) | \
(((WD_COLOR)(b)&0xff) << 0))
#define WD_ARGB(a, r, g, b) \
((((WD_COLOR)(a) & 0xff) << 24) | (((WD_COLOR)(r) & 0xff) << 16) | (((WD_COLOR)(g) & 0xff) << 8) | \
(((WD_COLOR)(b) & 0xff) << 0))
#define WD_RGB(r, g, b) WD_ARGB(255, (r), (g), (b))

#define WD_AVALUE(color) (((WD_COLOR)(color)&0xff000000U) >> 24)
#define WD_RVALUE(color) (((WD_COLOR)(color)&0x00ff0000U) >> 16)
#define WD_GVALUE(color) (((WD_COLOR)(color)&0x0000ff00U) >> 8)
#define WD_BVALUE(color) (((WD_COLOR)(color)&0x000000ffU) >> 0)
#define WD_AVALUE(color) (((WD_COLOR)(color) & 0xff000000U) >> 24)
#define WD_RVALUE(color) (((WD_COLOR)(color) & 0x00ff0000U) >> 16)
#define WD_GVALUE(color) (((WD_COLOR)(color) & 0x0000ff00U) >> 8)
#define WD_BVALUE(color) (((WD_COLOR)(color) & 0x000000ffU) >> 0)

/* Create WD_COLOR from GDI's COLORREF. */
#define WD_COLOR_FROM_GDI_EX(a, cref) WD_ARGB((a), GetRValue(cref), GetGValue(cref), GetBValue(cref))
Expand Down

0 comments on commit 9769d6a

Please sign in to comment.