From: Enlightenment S. <no-...@en...> - 2008-12-17 06:04:20
|
Log: Tue Dec 16 22:03:54 2008 Michael Jennings (mej) Fix compile errors related to the removal of unnecessary typecasting macros. ---------------------------------------------------------------------- Author: mej Date: 2008-12-16 22:04:15 -0800 (Tue, 16 Dec 2008) New Revision: 38171 Modified: trunk/eterm/Eterm/ChangeLog trunk/eterm/Eterm/src/command.c trunk/eterm/Eterm/src/e.c trunk/eterm/Eterm/src/misc.c trunk/eterm/Eterm/src/options.c trunk/eterm/Eterm/src/screen.c trunk/eterm/Eterm/src/windows.c Modified: trunk/eterm/Eterm/ChangeLog =================================================================== --- trunk/eterm/Eterm/ChangeLog 2008-12-16 23:01:53 UTC (rev 38170) +++ trunk/eterm/Eterm/ChangeLog 2008-12-17 06:04:15 UTC (rev 38171) @@ -5581,3 +5581,8 @@ Eterm 0.9.5 release. ---------------------------------------------------------------------- +Tue Dec 16 22:03:54 2008 Michael Jennings (mej) + +Fix compile errors related to the removal of unnecessary typecasting +macros. +---------------------------------------------------------------------- Modified: trunk/eterm/Eterm/src/command.c =================================================================== --- trunk/eterm/Eterm/src/command.c 2008-12-16 23:01:53 UTC (rev 38170) +++ trunk/eterm/Eterm/src/command.c 2008-12-17 06:04:15 UTC (rev 38171) @@ -3656,7 +3656,7 @@ set_multichar_encoding("utf8"); } handle = iconv_open("WCHAR_T", "UTF-8"); - if (handle == SPIF_CAST_C(iconv_t) - 1) { + if (handle == (iconv_t) -1) { libast_print_error("Unable to decode UTF-8 locale %s to WCHAR_T. Defaulting to portable C locale.\n", setlocale(LC_ALL, "")); setlocale(LC_ALL, "C"); @@ -3670,7 +3670,7 @@ pinbuff = (char *) str; bufflen = cmdbuf_ptr - str; outlen = bufflen * 6; - poutbuff = outbuff = SPIF_CAST_C(char *) MALLOC(outlen); + poutbuff = outbuff = (char *) MALLOC(outlen); errno = 0; D_VT(("Allocated output buffer of %lu chars at %010p against input buffer of %lu\n", bufflen * 6, outbuff, @@ -3697,11 +3697,11 @@ libast_print_warning("Moo2: %s\n", safe_print_string(outbuff, outlen)); MEMSET(outbuff + outlen, 0, sizeof(wchar_t)); - wcbuff = SPIF_CAST_C(wchar_t *) outbuff; + wcbuff = (wchar_t *) outbuff; MEMSET(&mbs, 0, sizeof(mbstate_t)); outlen = wcsrtombs(NULL, &wcbuff, 0, &mbs) + 1; if (outlen > 0) { - outbuff = SPIF_CAST_C(char *) MALLOC(outlen); + outbuff = (char *) MALLOC(outlen); outlen = wcsrtombs(outbuff, &wcbuff, outlen, &mbs); if ((long) outlen >= 0) { Modified: trunk/eterm/Eterm/src/e.c =================================================================== --- trunk/eterm/Eterm/src/e.c 2008-12-16 23:01:53 UTC (rev 38170) +++ trunk/eterm/Eterm/src/e.c 2008-12-17 06:04:15 UTC (rev 38171) @@ -104,8 +104,8 @@ } /* Make sure the version string is within the acceptable range. */ - if (SPIF_CMP_IS_LESS(spiftool_version_compare(SPIF_CAST(charptr) str, SPIF_CAST(charptr) "0.16.4")) - || SPIF_CMP_IS_GREATER(spiftool_version_compare(SPIF_CAST(charptr) str, SPIF_CAST(charptr) "0.16.999"))) { + if (SPIF_CMP_IS_LESS(spiftool_version_compare((spif_charptr_t) str, (spif_charptr_t) "0.16.4")) + || SPIF_CMP_IS_GREATER(spiftool_version_compare((spif_charptr_t) str, (spif_charptr_t) "0.16.999"))) { D_ENL((" -> IPC version string \"%s\" out of range. I'll have to ignore it.\n")); ipc_win = None; } Modified: trunk/eterm/Eterm/src/misc.c =================================================================== --- trunk/eterm/Eterm/src/misc.c 2008-12-16 23:01:53 UTC (rev 38170) +++ trunk/eterm/Eterm/src/misc.c 2008-12-17 06:04:15 UTC (rev 38171) @@ -75,7 +75,7 @@ str_trim(char *str) { - register char *tmp = str; + register spif_charptr_t tmp = (spif_charptr_t) str; size_t n; if (str && *str) { @@ -234,7 +234,7 @@ } /* The escaped string will be at most twice the length of the original. */ - buff = SPIF_CAST(charptr) MALLOC(strlen(SPIF_CAST_PTR(char) str) * 2 + 1); + buff = (spif_charptr_t) MALLOC(strlen((char *) str) * 2 + 1); /* Copy and escape the string from str into buff. */ for (pbuff = buff; (*s); s++, pbuff++) { @@ -316,7 +316,7 @@ register unsigned char *out, *outp, *in; register unsigned long i; - D_CMD(("buff == %8p \"%s\", cnt == %lu\n", buff, safe_print_string(buff, cnt), cnt)); + D_CMD(("buff == %8p \"%s\", cnt == %lu\n", buff, safe_print_string((spif_charptr_t) buff, cnt), cnt)); outp = out = (unsigned char *) MALLOC(cnt * 2); for (i = 0, in = buff; i < cnt; i++) { if (*in == '\n') { @@ -327,14 +327,14 @@ i = (unsigned long) (out - outp); memcpy(buff, outp, i); FREE(outp); - D_CMD(("buff == %8p \"%s\", i == %lu\n", buff, safe_print_string(buff, i), i)); + D_CMD(("buff == %8p \"%s\", i == %lu\n", buff, safe_print_string((spif_charptr_t) buff, i), i)); return i; } unsigned char mkdirhier(const char *path) { - char *str, *pstr; + spif_charptr_t str, pstr; struct stat dst; D_CMD(("path == %s\n", path)); Modified: trunk/eterm/Eterm/src/options.c =================================================================== --- trunk/eterm/Eterm/src/options.c 2008-12-16 23:01:53 UTC (rev 38170) +++ trunk/eterm/Eterm/src/options.c 2008-12-17 06:04:15 UTC (rev 38171) @@ -2577,20 +2577,20 @@ spifconf_init_subsystem(); /* Register Eterm's context parsers. */ - spifconf_register_context("color", SPIF_CAST_C(ctx_handler_t) parse_color); - spifconf_register_context("attributes", SPIF_CAST_C(ctx_handler_t) parse_attributes); - spifconf_register_context("toggles", SPIF_CAST_C(ctx_handler_t) parse_toggles); - spifconf_register_context("keyboard", SPIF_CAST_C(ctx_handler_t) parse_keyboard); - spifconf_register_context("misc", SPIF_CAST_C(ctx_handler_t) parse_misc); - spifconf_register_context("imageclasses", SPIF_CAST_C(ctx_handler_t) parse_imageclasses); - spifconf_register_context("image", SPIF_CAST_C(ctx_handler_t) parse_image); - spifconf_register_context("actions", SPIF_CAST_C(ctx_handler_t) parse_actions); - spifconf_register_context("menu", SPIF_CAST_C(ctx_handler_t) parse_menu); - spifconf_register_context("menuitem", SPIF_CAST_C(ctx_handler_t) parse_menuitem); - spifconf_register_context("button_bar", SPIF_CAST_C(ctx_handler_t) parse_bbar); - spifconf_register_context("xim", SPIF_CAST_C(ctx_handler_t) parse_xim); - spifconf_register_context("multichar", SPIF_CAST_C(ctx_handler_t) parse_multichar); - spifconf_register_context("escreen", SPIF_CAST_C(ctx_handler_t) parse_escreen); + spifconf_register_context("color", (ctx_handler_t) parse_color); + spifconf_register_context("attributes", (ctx_handler_t) parse_attributes); + spifconf_register_context("toggles", (ctx_handler_t) parse_toggles); + spifconf_register_context("keyboard", (ctx_handler_t) parse_keyboard); + spifconf_register_context("misc", (ctx_handler_t) parse_misc); + spifconf_register_context("imageclasses", (ctx_handler_t) parse_imageclasses); + spifconf_register_context("image", (ctx_handler_t) parse_image); + spifconf_register_context("actions", (ctx_handler_t) parse_actions); + spifconf_register_context("menu", (ctx_handler_t) parse_menu); + spifconf_register_context("menuitem", (ctx_handler_t) parse_menuitem); + spifconf_register_context("button_bar", (ctx_handler_t) parse_bbar); + spifconf_register_context("xim", (ctx_handler_t) parse_xim); + spifconf_register_context("multichar", (ctx_handler_t) parse_multichar); + spifconf_register_context("escreen", (ctx_handler_t) parse_escreen); } /* Sync up options with our internal data after parsing options and configs */ @@ -3885,10 +3885,7 @@ fprintf(fp, " min_anchor_size %d\n", rs_min_anchor_size); fprintf(fp, " border_width %d\n", TermWin.internalBorder); fprintf(fp, " term_name %s\n", getenv("TERM")); - fprintf(fp, " beep_command \"%s\"\n", SPIF_CAST_PTR(char) ((rs_beep_command) - ? (SPIF_CAST_PTR(char) rs_beep_command) - : (SPIF_CAST_PTR(char) "") - )); + fprintf(fp, " beep_command \"%s\"\n", (char *) ((rs_beep_command) ? (rs_beep_command) : (""))); fprintf(fp, " debug %d\n", DEBUG_LEVEL); if (save_theme && rs_exec_args && rs_theme && strcmp(rs_theme, PACKAGE)) { @@ -3902,7 +3899,7 @@ if (rs_cutchars) { spif_charptr_t cut_chars_escaped; - cut_chars_escaped = escape_string(SPIF_CAST(charptr) rs_cutchars, '\"', 0); + cut_chars_escaped = escape_string((spif_charptr_t) rs_cutchars, '\"', 0); fprintf(fp, " cut_chars \"%s\"\n", (char *) cut_chars_escaped); } #endif Modified: trunk/eterm/Eterm/src/screen.c =================================================================== --- trunk/eterm/Eterm/src/screen.c 2008-12-16 23:01:53 UTC (rev 38170) +++ trunk/eterm/Eterm/src/screen.c 2008-12-17 06:04:15 UTC (rev 38171) @@ -1570,7 +1570,7 @@ scr_rvideo_mode(!rvideo); scr_rvideo_mode(!rvideo); } else if (!SPIF_PTR_ISNULL(rs_beep_command) && (*rs_beep_command)) { - system_no_wait(SPIF_CAST_C(char *)rs_beep_command); + system_no_wait((char *) rs_beep_command); } else { XBell(Xdisplay, 0); } Modified: trunk/eterm/Eterm/src/windows.c =================================================================== --- trunk/eterm/Eterm/src/windows.c 2008-12-16 23:01:53 UTC (rev 38170) +++ trunk/eterm/Eterm/src/windows.c 2008-12-17 06:04:15 UTC (rev 38171) @@ -507,7 +507,7 @@ /* Set startup ID property if given by the launching application. */ if (getenv("DESKTOP_STARTUP_ID")) { Atom atom; - unsigned char *tmp = SPIF_CAST_PTR(uchar) getenv("DESKTOP_STARTUP_ID"); + unsigned char *tmp = (spif_uchar_t *) getenv("DESKTOP_STARTUP_ID"); atom = XInternAtom(Xdisplay, "UTF8_STRING", False); XChangeProperty(Xdisplay, TermWin.parent, props[PROP_EWMH_STARTUP_ID], atom, 8, PropModeReplace, tmp, strlen(tmp) + 1); @@ -517,9 +517,9 @@ /* Set window opacity if needed. */ if ((props[PROP_EWMH_OPACITY] != None) && (rs_opacity != 0xff)) { XChangeProperty(Xdisplay, TermWin.parent, props[PROP_EWMH_OPACITY], - XA_CARDINAL, 32, PropModeReplace, SPIF_CAST_PTR(uchar) & rs_opacity, 1); + XA_CARDINAL, 32, PropModeReplace, (spif_uchar_t *) &rs_opacity, 1); XChangeProperty(Xdisplay, TermWin.vt, props[PROP_EWMH_OPACITY], - XA_CARDINAL, 32, PropModeReplace, SPIF_CAST_PTR(uchar) & rs_opacity, 1); + XA_CARDINAL, 32, PropModeReplace, (spif_uchar_t *) &rs_opacity, 1); } /* We're done creating our windows. Now let's initialize the event subsystem to handle them. */ |