Fixed some GCC warnings and errors.

This commit is contained in:
David Capello 2010-03-30 09:48:19 -03:00
parent ffdd4cf848
commit a7ecb08f2c
15 changed files with 13 additions and 37 deletions

View File

@ -18,9 +18,9 @@ endif
CFLAGS =
LFLAGS = -mwindows -lshlwapi
ifdef DEBUGMODE
LFLAGS_LAST = -lalld -lpsapi
LFLAGS_LAST = -lalld -lpsapi -lwininet
else
LFLAGS_LAST = -lalleg
LFLAGS_LAST = -lalleg -lwininet
endif
WITHICON = 1

View File

@ -42,7 +42,6 @@ static int old_card, old_w, old_h, old_depth, old_scaling;
static int timer_to_accept;
static int seconds_to_accept;
static void show_dialog(Context* context);
static bool try_new_gfx_mode(Context* context);
static bool alert_msg_proc(JWidget widget, JMessage msg);
@ -195,7 +194,7 @@ void ConfigureScreen::load_resolutions(JWidget resolution, JWidget color_depth,
if (aspect)
sprintf(buf, "%dx%d (%s)", w, h, aspect);
else
sprintf(buf, "%dx%d", w, h, aspect);
sprintf(buf, "%dx%d", w, h);
jcombobox_add_string(resolution, buf, NULL);
if (old_w == w && old_h == h) {

View File

@ -919,7 +919,7 @@ static void read_compressed_image(FILE* f, Image* image, size_t chunk_end, FileO
uncompressed_offset = 0;
for (y=0; y<image->h; y++) {
ImageTraits::address_t address = image_address_fast<ImageTraits>(image, 0, y);
typename ImageTraits::address_t address = image_address_fast<ImageTraits>(image, 0, y);
pixel_io.read_scanline(address, image->w, &uncompressed[uncompressed_offset]);
uncompressed_offset += ImageTraits::scanline_size(image->w);
@ -948,7 +948,7 @@ static void write_compressed_image(FILE* f, Image* image)
std::vector<ase_uint8> compressed(4096);
for (y=0; y<image->h; y++) {
ImageTraits::address_t address = image_address_fast<ImageTraits>(image, 0, y);
typename ImageTraits::address_t address = image_address_fast<ImageTraits>(image, 0, y);
pixel_io.write_scanline(address, image->w, &scanline[0]);
zstream.next_in = (Bytef*)&scanline[0];

View File

@ -276,11 +276,11 @@ static JWidget convert_xmlelement_to_widget(TiXmlElement* elem)
}
/* textbox */
else if (ustrcmp(elem_name, "textbox") == 0) {
bool wordwrap = bool_attr_is_true(elem, "wordwrap");
//bool wordwrap = bool_attr_is_true(elem, "wordwrap");
/* TODO add translatable support */
/* TODO here we need jxmlelem_get_text(elem) */
/* widget = jtextbox_new(tag->text, wordwrap ? JI_WORDWRAP: 0); */
/* widget = jtextbox_new(tag->text, wordwrap ? JI_WORDWRAP: 0); */
assert(false);
}
/* view */

View File

@ -49,8 +49,6 @@
#include "jinete/jinete.h"
#include "jinete/jintern.h"
static bool widget_msg_proc(JWidget widget, JMessage msg);
int ji_register_widget_type()
{
static int type = JI_USER_WIDGET;

View File

@ -69,7 +69,7 @@ int vaca_main()
#ifndef DEBUGMODE
try {
#endif DEBUGMODE
#endif
Jinete jinete;
App app;

View File

@ -493,7 +493,6 @@ void draw_color_button(BITMAP* bmp,
int imgtype, color_t color, bool hot, bool drag)
{
SkinneableTheme* theme = (SkinneableTheme*)ji_get_theme();
int fore = ji_color_foreground();
int scale = jguiscale();
// Draw background (the color)

View File

@ -44,11 +44,6 @@
#define COLOR_SELECTED makecol(44, 76, 145)
#define COLOR_BACKGROUND makecol(255, 255, 255)
static struct
{
int x, y, w, h;
} sheet_info[PARTS];
static std::map<std::string, int> sheet_mapping;
static struct

View File

@ -445,7 +445,7 @@ void image_resize(const Image* src, Image* dst, ResizeMethod method, Palette* pa
// TODO optimize this
case RESIZE_METHOD_BILINEAR: {
ase_uint32 color[4], dst_color;
ase_uint32 color[4], dst_color = 0;
double u, v, du, dv;
int u_floor, u_floor2;
int v_floor, v_floor2;

View File

@ -427,7 +427,6 @@ static void run_undo(Undo* undo, int state)
static void discard_undo_tail(Undo* undo)
{
UndoStream* undo_stream = undo->undo_stream;
UndoStream* redo_stream = undo->redo_stream;
UndoChunk* chunk;
int level = 0;
@ -476,7 +475,7 @@ static int count_undo_groups(UndoStream* undo_stream)
static bool out_of_group(UndoStream* undo_stream)
{
UndoChunk* chunk;
int level;
int level = 0;
JLink link;
link = jlist_first(undo_stream->chunks);

View File

@ -311,7 +311,7 @@ public:
void setOpacity(int opacity) { m_opacity = opacity; }
void setFilled(bool state) { m_filled = state; }
bool setPreviewFilled(bool state) { m_previewFilled = state; }
void setPreviewFilled(bool state) { m_previewFilled = state; }
void setSprayWidth(int width) { m_spray_width = width; }
void setSpraySpeed(int speed) { m_spray_speed = speed; }

View File

@ -232,7 +232,7 @@ static void get_win32_clipboard_bitmap(Image*& image, Palette*& palette)
case 24: {
ase_uint8* src = (((ase_uint8*)bi)+bi->bmiHeader.biSize);
ase_uint8 r, g, b;
int padding = (4-(image->w*3)&3)&3;
int padding = (4-((image->w*3)&3))&3;
for (int y=image->h-1; y>=0; --y) {
ase_uint32* dst = (ase_uint32*)image->line[y];
@ -254,7 +254,7 @@ static void get_win32_clipboard_bitmap(Image*& image, Palette*& palette)
// TODO I am not sure if this really works
ase_uint8* src = (((ase_uint8*)bi)+bi->bmiHeader.biSize);
ase_uint8 b1, b2, r, g, b;
int padding = (4-(image->w*2)&3)&3;
int padding = (4-((image->w*2)&3))&3;
for (int y=image->h-1; y>=0; --y) {
for (int x=0; x<image->w; ++x) {

View File

@ -708,9 +708,6 @@ static bool editor_view_msg_proc(JWidget widget, JMessage msg)
/**********************************************************************/
/* message handler for the editor */
static int click_last_x = 0;
static int click_last_y = 0;
bool Editor::msg_proc(JMessage msg)
{
assert((m_state == EDITOR_STATE_DRAWING && m_toolLoopManager != NULL) ||

View File

@ -72,7 +72,6 @@ static int get_max_scroll_x(JWidget widget);
static void make_tab_visible(JWidget widget, Tab *tab);
static void set_scroll_x(JWidget widget, int scroll_x);
static void calculate_hot(JWidget widget);
static void draw_bevel_box(JRect box, int c1, int c2, int bottom);
/**************************************************************/
/* Tabs */
@ -536,11 +535,3 @@ static void calculate_hot(JWidget widget)
jrect_free(rect);
jrect_free(box);
}
static void draw_bevel_box(JRect box, int c1, int c2, int bottom)
{
hline(ji_screen, box->x1+1, box->y1, box->x2-2, c1); /* top */
hline(ji_screen, box->x1, box->y2-1, box->x2-1, bottom); /* bottom */
vline(ji_screen, box->x1, box->y1+1, box->y2-2, c1); /* left */
vline(ji_screen, box->x2-1, box->y1+1, box->y2-2, c2); /* right */
}

View File

@ -253,7 +253,6 @@ bool ToolBar::msg_proc(JMessage msg)
case JM_BUTTONPRESSED: {
ToolBox* toolbox = App::instance()->get_toolbox();
int groups = toolbox->getGroupsCount();
int y = rc->y1;
Rect toolrc;
closeTipWindow();
@ -636,7 +635,6 @@ bool ToolStrip::msg_proc(JMessage msg)
Rect ToolStrip::getToolBounds(int index)
{
ToolBox* toolbox = App::instance()->get_toolbox();
Size iconsize = getToolIconSize(this);
return Rect(rc->x1+index*(iconsize.w-1), rc->y1,