From e5c3cdfcf5e16a9b0fc3e7766bfea1d9c326b3ae Mon Sep 17 00:00:00 2001 From: begasus Date: Fri, 6 Sep 2019 13:45:56 +0200 Subject: [PATCH] Haiku fixes --- Makefile | 2 -- src/fonts.c | 4 +++- src/i18n.c | 4 ++-- src/im.c | 18 +++++++++--------- src/tuxpaint.c | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index e3fc13b3e..2a6449e04 100644 --- a/Makefile +++ b/Makefile @@ -131,7 +131,6 @@ ARCH_HEADERS:=$($(OS)_ARCH_HEADERS) # For macOS, the prefix is relative to DESTDIR. windows_PREFIX:=/usr/local osx_PREFIX:=Resources -beos_PREFIX=$(shell finddir B_APPS_DIRECTORY)/TuxPaint linux_PREFIX:=/usr/local PREFIX:=$($(OS)_PREFIX) @@ -462,7 +461,6 @@ trans: windows_ARCH_INSTALL:= osx_ARCH_INSTALL:=install-macbundle TuxPaint.dmg -beos_ARCH_INSTALL:=install-haiku linux_ARCH_INSTALL:=install-kde install-kde-icons ARCH_INSTALL:=$($(OS)_ARCH_INSTALL) diff --git a/src/fonts.c b/src/fonts.c index d6a5ad525..f7290e95b 100644 --- a/src/fonts.c +++ b/src/fonts.c @@ -970,10 +970,12 @@ static void loadfonts(SDL_Surface * screen, const char *const dir) result = find_directory(B_SYSTEM_FONTS_DIRECTORY, volume, false, buffer, sizeof(buffer)); loadfonts(screen, buffer); - result = find_directory(B_COMMON_FONTS_DIRECTORY, volume, false, buffer, sizeof(buffer)); + result = find_directory(B_SYSTEM_NONPACKAGED_FONTS_DIRECTORY, volume, false, buffer, sizeof(buffer)); loadfonts(screen, buffer); result = find_directory(B_USER_FONTS_DIRECTORY, volume, false, buffer, sizeof(buffer)); loadfonts(screen, buffer); + result = find_directory(B_USER_NONPACKAGED_FONTS_DIRECTORY, volume, false, buffer, sizeof(buffer)); + loadfonts(screen, buffer); #elif defined(__APPLE__) loadfonts(screen, "/System/Library/Fonts"); loadfonts(screen, "/Library/Fonts"); diff --git a/src/i18n.c b/src/i18n.c index df6fb1a03..ce94092dc 100644 --- a/src/i18n.c +++ b/src/i18n.c @@ -986,8 +986,10 @@ static int set_current_language(const char *restrict locale_choice) MUST_CHECK; static int set_current_language(const char *restrict loc) { int i; + int j = 0; char *oldloc; char *env_language; + char *env_language_lang; if (strlen(loc) > 0) @@ -1082,8 +1084,6 @@ static int set_current_language(const char *restrict loc) mysetenv("LANGUAGE", "C"); } env_language = strdup(getenv("LANGUAGE")); - int j = 0; - char *env_language_lang; if (*env_language) { diff --git a/src/im.c b/src/im.c index 7808a336e..138cfad4f 100644 --- a/src/im.c +++ b/src/im.c @@ -905,12 +905,12 @@ static int im_event_zh_tw(IM_DATA * im, SDL_keysym ks) case IM_REQ_FREE: /* Free allocated resources */ charmap_free(&cm); - __attribute__ ((fallthrough)); /* go onto full reset */ + // // __attribute__ ((fallthrough)); /* go onto full reset */ case IM_REQ_RESET_FULL: /* Full reset */ cm.section = SEC_ENGLISH; im->tip_text = im_tip_text[IM_TIP_ENGLISH]; - __attribute__ ((fallthrough)); /* go onto soft reset */ + // __attribute__ ((fallthrough)); /* go onto soft reset */ case IM_REQ_RESET_SOFT: /* Soft reset */ im->s[0] = L'\0'; @@ -1124,12 +1124,12 @@ static int im_event_th(IM_DATA * im, SDL_keysym ks) case IM_REQ_FREE: /* Free allocated resources */ charmap_free(&cm); - __attribute__ ((fallthrough)); /* go onto full reset */ + // __attribute__ ((fallthrough)); /* go onto full reset */ case IM_REQ_RESET_FULL: /* Full reset */ cm.section = SEC_ENGLISH; im->tip_text = im_tip_text[IM_TIP_ENGLISH]; - __attribute__ ((fallthrough)); /* go onto soft reset */ + // __attribute__ ((fallthrough)); /* go onto soft reset */ case IM_REQ_RESET_SOFT: /* Soft reset */ im->s[0] = L'\0'; @@ -1343,12 +1343,12 @@ static int im_event_ja(IM_DATA * im, SDL_keysym ks) case IM_REQ_FREE: /* Free allocated resources */ charmap_free(&cm); - __attribute__ ((fallthrough)); /* go onto full reset */ + // __attribute__ ((fallthrough)); /* go onto full reset */ case IM_REQ_RESET_FULL: /* Full reset */ cm.section = SEC_ENGLISH; im->tip_text = im_tip_text[IM_TIP_ENGLISH]; - __attribute__ ((fallthrough)); /* go onto soft reset */ + // __attribute__ ((fallthrough)); /* go onto soft reset */ case IM_REQ_RESET_SOFT: /* Soft reset */ im->s[0] = L'\0'; @@ -1590,12 +1590,12 @@ static int im_event_ko(IM_DATA * im, SDL_keysym ks) case IM_REQ_FREE: /* Free allocated resources */ charmap_free(&cm); - __attribute__ ((fallthrough)); /* go onto full reset */ + // __attribute__ ((fallthrough)); /* go onto full reset */ case IM_REQ_RESET_FULL: /* Full reset */ cm.section = SEC_ENGLISH; im->tip_text = im_tip_text[IM_TIP_ENGLISH]; - __attribute__ ((fallthrough)); /* go onto soft reset */ + // __attribute__ ((fallthrough)); /* go onto soft reset */ case IM_REQ_RESET_SOFT: /* Soft reset */ im->s[0] = L'\0'; @@ -1681,7 +1681,7 @@ static int im_event_ko(IM_DATA * im, SDL_keysym ks) im->redraw--; ks.unicode = L'\0'; } - __attribute__ ((fallthrough)); /* continue processing: */ + // __attribute__ ((fallthrough)); /* continue processing: */ /* Actual character processing */ default: diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 2cf755bf6..2435b4884 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -19809,6 +19809,7 @@ static int do_color_sel(void) int done, chose; int back_left, back_top; int color_sel_x = 0, color_sel_y = 0; + int want_animated_popups = 1; SDL_Surface *tmp_btn_up, *tmp_btn_down; Uint32(*getpixel_tmp_btn_up) (SDL_Surface *, int, int); @@ -19829,7 +19830,6 @@ static int do_color_sel(void) /* FIXME this is the first step to make animated popups optional, to be removed from here when implemented in a more general way */ - int want_animated_popups = 1; hide_blinking_cursor(); @@ -22438,7 +22438,7 @@ static void setup_config(char *argv[]) char buffer[B_PATH_NAME_LENGTH + B_FILE_NAME_LENGTH]; status_t result; - result = find_directory(B_USER_DIRECTORY, volume, false, buffer, sizeof(buffer)); + result = find_directory(B_USER_SETTINGS_DIRECTORY, volume, false, buffer, sizeof(buffer)); asprintf((char **)&savedir, "%s/%s", buffer, "TuxPaint"); #elif __APPLE__ savedir = strdup(macos_preferencesPath());