Fixed some compilation errors in gcc 64 bits (reported by Scott Wilson).

This commit is contained in:
David Capello 2009-02-21 19:57:57 +00:00
parent 2a81f3e285
commit 09578c2f23
10 changed files with 54 additions and 53 deletions

View File

@ -29,6 +29,7 @@ AUTHORS
Nora Amendez
Peter Wang (tjaden)
Robert J Ohannessian (Bob)
Scott Wilson
Trent Gamblin (trentg)

View File

@ -1,3 +1,7 @@
2009-02-21 David A. Capello <davidcapello@gmail.com>
* Fixed some compilation errors in gcc 64 bits (reported by Scott Wilson).
2009-01-24 David A. Capello <davidcapello@gmail.com>
* Version 0.6.1 released.

View File

@ -165,7 +165,7 @@ static bool color_change_hook(JWidget widget, void *data)
{
char buf[64];
sprintf(buf, "Color%d", (size_t)data);
sprintf(buf, "Color%u", (size_t)data);
set_config_color("ReplaceColor", buf, colorbutton_get_color(widget));
make_preview();

View File

@ -152,7 +152,7 @@ void console_printf(const char *format, ...)
jfree(final);
}
else {
printf(buf);
fputs(buf, stdout);
fflush(stdout);
}
}

View File

@ -140,13 +140,13 @@ static FileItemMap fileitems_map;
static ThumbnailMap thumbnail_map;
static unsigned int current_file_system_version = 0;
#ifdef WORKAROUND_64BITS_SUPPORT
static FileItem* for_each_child_callback_param;
#endif
#ifdef USE_PIDLS
static IMalloc* shl_imalloc = NULL;
static IShellFolder* shl_idesktop = NULL;
#else
#ifdef WORKAROUND_64BITS_SUPPORT
static FileItem* for_each_child_callback_param;
#endif
#endif
/* a more easy PIDLs interface (without using the SH* & IL* routines of W2K) */

View File

@ -302,8 +302,8 @@ struct RectTracker
int *pixel;
};
static void do_rect(BITMAP* bmp, int x1, int y1, int x2, int y2, int c,
void (*proc)(BITMAP* bmp, int x, int y, int c))
static void do_rect(BITMAP* bmp, int x1, int y1, int x2, int y2, RectTracker* rt,
void (*proc)(BITMAP* bmp, int x, int y, RectTracker* rt))
{
int x, y, u1, u2, v1, v2;
@ -316,12 +316,12 @@ static void do_rect(BITMAP* bmp, int x1, int y1, int x2, int y2, int c,
if ((y1 >= bmp->ct) && (y1 < bmp->cb)) {
for (x=u1; x<=u2; x++)
(*proc) (bmp, x, y1, c);
(*proc)(bmp, x, y1, rt);
}
if ((y2 >= bmp->ct) && (y2 < bmp->cb)) {
for (x=u1; x<=u2; x++)
(*proc) (bmp, x, y2, c);
(*proc)(bmp, x, y2, rt);
}
v1 = MID(bmp->ct, y1+1, bmp->cb-1);
@ -329,36 +329,33 @@ static void do_rect(BITMAP* bmp, int x1, int y1, int x2, int y2, int c,
if ((x1 >= bmp->cl) && (x1 < bmp->cr)) {
for (y=v1; y<=v2; y++)
(*proc)(bmp, x1, y, c);
(*proc)(bmp, x1, y, rt);
}
if ((x2 >= bmp->cl) && (x2 < bmp->cr)) {
for (y=v1; y<=v2; y++)
(*proc)(bmp, x2, y, c);
(*proc)(bmp, x2, y, rt);
}
}
static void count_rect(BITMAP* bmp, int x, int y, int c)
static void count_rect(BITMAP* bmp, int x, int y, RectTracker* rt)
{
RectTracker* data = (RectTracker*)c;
data->npixel++;
rt->npixel++;
}
static void save_rect(BITMAP* bmp, int x, int y, int c)
static void save_rect(BITMAP* bmp, int x, int y, RectTracker* rt)
{
RectTracker* data = (RectTracker*)c;
data->pixel[data->npixel++] = getpixel(bmp, x, y);
rt->pixel[rt->npixel++] = getpixel(bmp, x, y);
}
static void restore_rect(BITMAP* bmp, int x, int y, int c)
static void restore_rect(BITMAP* bmp, int x, int y, RectTracker* rt)
{
RectTracker* data = (RectTracker*)c;
putpixel(bmp, x, y, data->pixel[data->npixel++]);
putpixel(bmp, x, y, rt->pixel[rt->npixel++]);
}
RectTracker* rect_tracker_new(BITMAP* bmp, int x1, int y1, int x2, int y2)
{
RectTracker *data;
RectTracker* rt;
int x, y;
jmouse_hide();
@ -366,40 +363,39 @@ RectTracker* rect_tracker_new(BITMAP* bmp, int x1, int y1, int x2, int y2)
if (x1 > x2) { x = x1; x1 = x2; x2 = x; }
if (y1 > y2) { y = y1; y1 = y2; y2 = y; }
data = new RectTracker;
rt = new RectTracker;
data->bmp = bmp;
data->x1 = x1;
data->y1 = y1;
data->x2 = x2;
data->y2 = y2;
rt->bmp = bmp;
rt->x1 = x1;
rt->y1 = y1;
rt->x2 = x2;
rt->y2 = y2;
data->npixel = 0;
do_rect(bmp, x1, y1, x2, y2, (int)data, count_rect);
rt->npixel = 0;
do_rect(bmp, x1, y1, x2, y2, rt, count_rect);
if (data->npixel > 0)
data->pixel = new int[data->npixel];
if (rt->npixel > 0)
rt->pixel = new int[rt->npixel];
else
data->pixel = NULL;
rt->pixel = NULL;
data->npixel = 0;
do_rect(bmp, x1, y1, x2, y2, (int)data, save_rect);
rt->npixel = 0;
do_rect(bmp, x1, y1, x2, y2, rt, save_rect);
jmouse_show();
return data;
return rt;
}
void rect_tracker_free(RectTracker* data)
void rect_tracker_free(RectTracker* rt)
{
jmouse_hide();
data->npixel = 0;
do_rect(data->bmp, data->x1, data->y1, data->x2, data->y2,
(int)data, restore_rect);
rt->npixel = 0;
do_rect(rt->bmp, rt->x1, rt->y1, rt->x2, rt->y2, rt, restore_rect);
delete[] data->pixel;
delete data;
delete[] rt->pixel;
delete rt;
jmouse_show();
}

View File

@ -875,6 +875,6 @@ static void regen_theme_and_fixup_icons(void *data)
/* fixup the icons */
JI_LIST_FOR_EACH(icon_buttons, link) {
button = reinterpret_cast<JWidget>(link->data);
ji_generic_button_set_icon(button, get_gfx((int)button->user_data[3]));
ji_generic_button_set_icon(button, get_gfx((size_t)button->user_data[3]));
}
}

View File

@ -101,7 +101,7 @@ int group_button_get_selected(JWidget group)
JWidget sel = find_selected(group);
if (sel)
return (int)sel->user_data[1];
return (size_t)sel->user_data[1];
else
return -1;
}
@ -110,7 +110,7 @@ void group_button_select(JWidget group, int index)
{
JWidget sel = find_selected(group);
if (!sel || (int)sel->user_data[1] != index) {
if (!sel || (size_t)sel->user_data[1] != index) {
jwidget_deselect(sel);
select_button(group, index);
}
@ -137,7 +137,7 @@ static int select_button(JWidget widget, int index)
JLink link;
if (widget->type == JI_RADIO) {
if ((int)widget->user_data[1] == index) {
if ((size_t)widget->user_data[1] == index) {
jwidget_select(widget);
return TRUE;
}

View File

@ -173,7 +173,7 @@ void statusbar_show_tip(JWidget widget, int msecs, const char *format, ...)
else {
jwidget_set_text(tipwindow, buf);
jmanager_set_timer_interval((int)tipwindow->user_data[0], msecs);
jmanager_set_timer_interval((size_t)tipwindow->user_data[0], msecs);
}
if (jwidget_is_visible(tipwindow))
@ -186,7 +186,7 @@ void statusbar_show_tip(JWidget widget, int msecs, const char *format, ...)
y = widget->rc->y1 - jrect_h(tipwindow->rc);
jwindow_position(tipwindow, x, y);
jmanager_start_timer((int)tipwindow->user_data[0]);
jmanager_start_timer((size_t)tipwindow->user_data[0]);
}
void statusbar_show_color(JWidget widget, int msecs, int imgtype, color_t color)
@ -391,7 +391,7 @@ static bool tipwindow_msg_proc(JWidget widget, JMessage msg)
switch (msg->type) {
case JM_DESTROY:
jmanager_remove_timer((int)widget->user_data[0]);
jmanager_remove_timer((size_t)widget->user_data[0]);
break;
case JM_TIMER:
@ -431,7 +431,7 @@ static void button_command(JWidget widget, void *data)
if (sprite) {
const char *cmd = NULL;
switch ((int)data) {
switch ((size_t)data) {
case ACTION_LAYER:
cmd = CMD_LAYER_PROPERTIES;

View File

@ -126,7 +126,7 @@ JWidget target_button_new(int imgtype, bool with_channels)
int target_button_get_target(JWidget widget)
{
return (int)widget->user_data[0];
return (size_t)widget->user_data[0];
}
void target_button_set_target(JWidget widget, int target)
@ -155,7 +155,7 @@ void target_button_set_target(JWidget widget, int target)
static bool channel_change_hook(JWidget widget, void *data)
{
JWidget target_button = (JWidget)data;
int target = (int)target_button->user_data[0];
int target = (size_t)target_button->user_data[0];
int flag = 0;
switch (*widget->name) {
@ -183,7 +183,7 @@ static bool channel_change_hook(JWidget widget, void *data)
static bool images_change_hook(JWidget widget, void *data)
{
JWidget target_button = (JWidget)data;
int target = (int)target_button->user_data[0];
int target = (size_t)target_button->user_data[0];
/* rotate target */
if (target & TARGET_ALL_FRAMES) {