diff --git a/src/commands/cmd_palette_editor.cpp b/src/commands/cmd_palette_editor.cpp index 3514337eb..47c1a8749 100644 --- a/src/commands/cmd_palette_editor.cpp +++ b/src/commands/cmd_palette_editor.cpp @@ -729,7 +729,6 @@ static void quantize_command(JWidget widget) static bool sliderRGB_change_hook(JWidget widget, void *data) { - Palette* palette = get_current_palette(); int r = jslider_get_value(R_slider); int g = jslider_get_value(G_slider); int b = jslider_get_value(B_slider); @@ -750,7 +749,6 @@ static bool sliderRGB_change_hook(JWidget widget, void *data) static bool sliderHSV_change_hook(JWidget widget, void *data) { - Palette* palette = get_current_palette(); int h = jslider_get_value(H_slider); int s = jslider_get_value(S_slider); int v = jslider_get_value(V_slider); @@ -795,7 +793,6 @@ static bool entryRGB_change_hook(JWidget widget, void *data) static bool entryHSV_change_hook(JWidget widget, void *data) { - Palette* palette = get_current_palette(); int h = H_entry->getTextInt(); int s = S_entry->getTextInt(); int v = V_entry->getTextInt(); diff --git a/src/core/color.cpp b/src/core/color.cpp index 094a84a65..ee2067d69 100644 --- a/src/core/color.cpp +++ b/src/core/color.cpp @@ -709,7 +709,7 @@ void color_to_formalstring(int imgtype, color_t color, switch (GET_COLOR_TYPE(color)) { case COLOR_TYPE_MASK: - uszprintf(buf, size, _("Mask")); + ustrncpy(buf, _("Mask"), size); break; case COLOR_TYPE_RGB: diff --git a/src/file/ase_format.cpp b/src/file/ase_format.cpp index 0166edaad..abaffae7f 100644 --- a/src/file/ase_format.cpp +++ b/src/file/ase_format.cpp @@ -968,7 +968,7 @@ static void write_compressed_image(FILE* f, Image* image) int output_bytes = compressed.size() - zstream.avail_out; if (output_bytes > 0) { - if ((fwrite(&compressed[0], 1, output_bytes, f) != output_bytes) + if ((fwrite(&compressed[0], 1, output_bytes, f) != (size_t)output_bytes) || ferror(f)) throw ase_exception("Error writing compressed image pixels.\n"); } diff --git a/src/jinete/jentry.cpp b/src/jinete/jentry.cpp index 27332199c..47af4d170 100644 --- a/src/jinete/jentry.cpp +++ b/src/jinete/jentry.cpp @@ -523,6 +523,9 @@ static void entry_execute_cmd(JWidget widget, EntryCmd::Type cmd, switch (cmd) { + case EntryCmd::NoOp: + break; + case EntryCmd::InsertChar: // delete the entire selection if (selbeg >= 0) { diff --git a/src/jinete/jstream.cpp b/src/jinete/jstream.cpp index 3e01474d8..fe8fcad41 100644 --- a/src/jinete/jstream.cpp +++ b/src/jinete/jstream.cpp @@ -81,7 +81,7 @@ static int stream_string_tell(JStream stream); JStream jstream_new(int size) { - JStream stream = (JStream)jmalloc0(MAX(size, sizeof(struct jstream))); + JStream stream = (JStream)jmalloc0(MAX(size, (int)sizeof(struct jstream))); if (!stream) return NULL; diff --git a/src/jinete/themes/jstandard_theme.cpp b/src/jinete/themes/jstandard_theme.cpp index 35afb8866..2f4fa988b 100644 --- a/src/jinete/themes/jstandard_theme.cpp +++ b/src/jinete/themes/jstandard_theme.cpp @@ -735,7 +735,7 @@ void jstandard_theme::draw_link_label(JWidget widget, JRect clip) if (widget->hasMouseOver()) { int w = jwidget_get_text_length(widget); - int h = jwidget_get_text_height(widget); + //int h = jwidget_get_text_height(widget); hline(ji_screen, widget->rc->x1, widget->rc->y2-1, widget->rc->x1+w-1, makecol(0, 0, 255)); diff --git a/src/modules/skinneable_theme.cpp b/src/modules/skinneable_theme.cpp index b14993c56..7581dbb7a 100644 --- a/src/modules/skinneable_theme.cpp +++ b/src/modules/skinneable_theme.cpp @@ -841,7 +841,7 @@ void SkinneableTheme::draw_link_label(JWidget widget, JRect clip) if (widget->hasMouseOver()) { int w = jwidget_get_text_length(widget); - int h = jwidget_get_text_height(widget); + //int h = jwidget_get_text_height(widget); hline(ji_screen, widget->rc->x1, widget->rc->y2-1, widget->rc->x1+w-1, makecol(0, 0, 255)); diff --git a/src/raster/image_impl.h b/src/raster/image_impl.h index 4131138ce..f006cbe2c 100644 --- a/src/raster/image_impl.h +++ b/src/raster/image_impl.h @@ -144,7 +144,7 @@ public: virtual void merge(const Image* src, int x, int y, int opacity, int blend_mode) { BLEND_COLOR blender = Traits::get_blender(blend_mode); - register int mask_color = src->mask_color; + register ase_uint32 mask_color = src->mask_color; Image* dst = this; address_t src_address; address_t dst_address; diff --git a/src/raster/palette.cpp b/src/raster/palette.cpp index 957492e43..a18f804ef 100644 --- a/src/raster/palette.cpp +++ b/src/raster/palette.cpp @@ -302,6 +302,9 @@ bool SortPalette::operator()(ase_uint32 c1, ase_uint32 c2) value1 = v1; value2 = v2; break; + default: + ASSERT(false); + break; } break; } diff --git a/src/raster/rgbmap.cpp b/src/raster/rgbmap.cpp index 289dc9960..85b649762 100644 --- a/src/raster/rgbmap.cpp +++ b/src/raster/rgbmap.cpp @@ -69,7 +69,7 @@ public: private: RGB_MAP* m_allegMap; gfxobj_id m_palette_id; - size_t m_modifications; + int m_modifications; }; ////////////////////////////////////////////////////////////////////// diff --git a/src/raster/undo.cpp b/src/raster/undo.cpp index 11ea7f462..36b0b4fe6 100644 --- a/src/raster/undo.cpp +++ b/src/raster/undo.cpp @@ -1808,7 +1808,7 @@ static UndoChunk* undo_chunk_new(UndoStream* stream, int type, int size) { UndoChunk* chunk; - ASSERT(size >= sizeof(UndoChunk)); + ASSERT(size >= (int)sizeof(UndoChunk)); chunk = (UndoChunk* )jmalloc0(size); if (!chunk) diff --git a/src/recent_files.cpp b/src/recent_files.cpp index 03d6627ab..6e3cd2204 100644 --- a/src/recent_files.cpp +++ b/src/recent_files.cpp @@ -86,7 +86,7 @@ void RecentFiles::addRecentFile(const char* filename) // If the filename does not exist... // Does the list is full? - if (recent_files.size() == recent_files_limit) { + if ((int)recent_files.size() == recent_files_limit) { // Remove the last entry recent_files.erase(--recent_files.end()); } diff --git a/src/resource_finder.cpp b/src/resource_finder.cpp index 5928f54ad..9236550de 100644 --- a/src/resource_finder.cpp +++ b/src/resource_finder.cpp @@ -38,7 +38,7 @@ const char* ResourceFinder::first() const char* ResourceFinder::next() { - if (m_current == m_paths.size()) + if (m_current == (int)m_paths.size()) return NULL; return m_paths[m_current++].c_str(); diff --git a/src/tools/ink_processing.h b/src/tools/ink_processing.h index 93deb4d24..3d5b7660d 100644 --- a/src/tools/ink_processing.h +++ b/src/tools/ink_processing.h @@ -309,8 +309,8 @@ static void ink_hline8_blur(int x1, int y, int x2, IToolLoop* loop) static void ink_hline32_replace(int x1, int y, int x2, IToolLoop* loop) { - int color1 = loop->getPrimaryColor(); - int color2 = loop->getSecondaryColor(); + ase_uint32 color1 = loop->getPrimaryColor(); + ase_uint32 color2 = loop->getSecondaryColor(); int opacity = loop->getOpacity(); DEFINE_INK_PROCESSING_SRCDST diff --git a/src/util/clipboard.cpp b/src/util/clipboard.cpp index c7b751f26..8595a1309 100644 --- a/src/util/clipboard.cpp +++ b/src/util/clipboard.cpp @@ -48,7 +48,7 @@ #include "widgets/colbar.h" #include "widgets/statebar.h" -static ase_uint32 get_shift_from_mask(ase_uint32 mask); +//static ase_uint32 get_shift_from_mask(ase_uint32 mask); #if defined ALLEGRO_WINDOWS #include @@ -143,14 +143,14 @@ static bool copy_from_sprite(const Sprite* sprite) return true; } -static ase_uint32 get_shift_from_mask(ase_uint32 mask) -{ - ase_uint32 shift = 0; - for (shift=0; shift<32; ++shift) - if (mask & (1 << shift)) - return shift; - return shift; -} +// static ase_uint32 get_shift_from_mask(ase_uint32 mask) +// { +// ase_uint32 shift = 0; +// for (shift=0; shift<32; ++shift) +// if (mask & (1 << shift)) +// return shift; +// return shift; +// } bool clipboard::can_paste() { diff --git a/src/util/render.cpp b/src/util/render.cpp index 2b327ed53..8594e2b3e 100644 --- a/src/util/render.cpp +++ b/src/util/render.cpp @@ -442,8 +442,6 @@ void RenderEngine::renderCheckedBackground(Image* image, int zoom) { int x, y, u, v; - int tile_x = 0; - int tile_y = 0; int tile_w = 16; int tile_h = 16; int c1 = get_color_for_image(image->imgtype, checked_bg_color1); diff --git a/src/widgets/colbar.cpp b/src/widgets/colbar.cpp index 3ad6b7f16..44f0cea22 100644 --- a/src/widgets/colbar.cpp +++ b/src/widgets/colbar.cpp @@ -358,8 +358,8 @@ bool ColorBar::onProcessMessage(JMessage msg) KB_SHIFT_FLAG)) == KB_CTRL_FLAG) { int newColorsPerColumn = m_colorsPerColumn; - while (((int)m_entrySize) >= ENTRYSIZE_MIN && - ((int)m_entrySize) <= ENTRYSIZE_MAX && + while (m_entrySize >= ENTRYSIZE_MIN && + m_entrySize <= ENTRYSIZE_MAX && newColorsPerColumn == m_colorsPerColumn) { // Increment or decrement m_entrySize until m_colorsPerColumnn changes m_entrySize += delta; @@ -376,7 +376,7 @@ bool ColorBar::onProcessMessage(JMessage msg) KB_SHIFT_FLAG)) == KB_ALT_FLAG) { int old_columns = m_columns; - if (((int)m_columns)+delta < 1) + if (m_columns+delta < 1) m_columns = 1; else if (m_columns+delta > 4) m_columns = 4; @@ -520,7 +520,7 @@ void ColorBar::setHotColor(hotcolor_t hot, color_t color) } } -Rect ColorBar::getColumnBounds(size_t column) const +Rect ColorBar::getColumnBounds(int column) const { Rect rc = getBounds().shrink(jguiscale()); Rect fgRc = getFgBounds(); @@ -532,10 +532,10 @@ Rect ColorBar::getColumnBounds(size_t column) const return rc; } -Rect ColorBar::getEntryBounds(size_t index) const +Rect ColorBar::getEntryBounds(int index) const { - size_t row = (index % m_colorsPerColumn); - size_t col = (index / m_colorsPerColumn); + int row = (index % m_colorsPerColumn); + int col = (index / m_colorsPerColumn); Rect rc = getColumnBounds(col); rc.h -= 2*jguiscale(); diff --git a/src/widgets/colbar.h b/src/widgets/colbar.h index 7772a8f19..ef7e188ce 100644 --- a/src/widgets/colbar.h +++ b/src/widgets/colbar.h @@ -52,19 +52,19 @@ protected: private: int getEntriesCount() const { return m_columns*m_colorsPerColumn; } - color_t getEntryColor(size_t i) const { return color_index(i+m_firstIndex); } + color_t getEntryColor(int i) const { return color_index(i+m_firstIndex); } color_t getHotColor(hotcolor_t hot); void setHotColor(hotcolor_t hot, color_t color); - Rect getColumnBounds(size_t column) const; - Rect getEntryBounds(size_t index) const; + Rect getColumnBounds(int column) const; + Rect getEntryBounds(int index) const; Rect getFgBounds() const; Rect getBgBounds() const; void updateStatusBar(color_t color, int msecs); - size_t m_firstIndex; - size_t m_columns; - size_t m_colorsPerColumn; + int m_firstIndex; + int m_columns; + int m_colorsPerColumn; int m_entrySize; color_t m_fgcolor; color_t m_bgcolor; diff --git a/src/widgets/colsel.cpp b/src/widgets/colsel.cpp index 336dfd51d..f6bacd0e4 100644 --- a/src/widgets/colsel.cpp +++ b/src/widgets/colsel.cpp @@ -286,7 +286,6 @@ static void colorselector_set_color2(JWidget widget, color_t color, Model* exclude_this_model) { ColorSelector* colorselector = colorselector_data(widget); - int imgtype = app_get_current_image_type(); Model* m = colorselector->selected_model; JWidget rgb_rslider = jwidget_find_name(widget, "rgb_r"); JWidget rgb_gslider = jwidget_find_name(widget, "rgb_g"); @@ -367,7 +366,6 @@ static void colorselector_set_color2(JWidget widget, color_t color, static void colorselector_set_paledit_index(JWidget widget, int index, bool select_index_entry) { - ColorSelector* colorselector = colorselector_data(widget); PalEdit* pal = static_cast(widget->findChild("pal")); Widget* idx = widget->findChild("idx"); char buf[256]; @@ -433,7 +431,6 @@ static bool slider_change_hook(JWidget widget, void* data) { Frame* window = static_cast(widget->getRoot()); ColorSelector* colorselector = colorselector_data(window); - PalEdit* pal = static_cast(window->findChild("pal")); Model* m = colorselector->selected_model; color_t color = colorselector->color; int i, r, g, b; diff --git a/src/widgets/editor/cursor.cpp b/src/widgets/editor/cursor.cpp index 3ff75e2be..d697be467 100644 --- a/src/widgets/editor/cursor.cpp +++ b/src/widgets/editor/cursor.cpp @@ -279,7 +279,7 @@ void Editor::editor_draw_cursor(int x, int y, bool refresh) ->getToolSettings(current_tool); int pen_color = get_pen_color(m_sprite); - int new_mask_color; + ase_uint32 new_mask_color; Pen* pen = editor_get_current_pen(); // Create the extra cel to show the pen preview diff --git a/src/widgets/editor/editor.cpp b/src/widgets/editor/editor.cpp index d312abc77..de7abdb62 100644 --- a/src/widgets/editor/editor.cpp +++ b/src/widgets/editor/editor.cpp @@ -1413,6 +1413,10 @@ bool Editor::onProcessMessage(JMessage msg) switch (wheelAction) { + case WHEEL_NONE: + // Do nothing + break; + case WHEEL_FG: if (m_state == EDITOR_STATE_STANDBY) { int newIndex = 0; diff --git a/src/widgets/groupbut.cpp b/src/widgets/groupbut.cpp index 20665b37f..07a9e3f18 100644 --- a/src/widgets/groupbut.cpp +++ b/src/widgets/groupbut.cpp @@ -101,7 +101,7 @@ int group_button_get_selected(JWidget group) JWidget sel = find_selected(group); if (sel) - return (size_t)sel->user_data[1]; + return (int)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 || (size_t)sel->user_data[1] != index) { + if (!sel || (int)sel->user_data[1] != index) { sel->setSelected(false); select_button(group, index); } @@ -137,7 +137,7 @@ static int select_button(JWidget widget, int index) JLink link; if (widget->type == JI_RADIO) { - if ((size_t)widget->user_data[1] == index) { + if ((int)widget->user_data[1] == index) { widget->setSelected(true); return true; } diff --git a/src/widgets/tabs.cpp b/src/widgets/tabs.cpp index 1f2d56c0d..143d45802 100644 --- a/src/widgets/tabs.cpp +++ b/src/widgets/tabs.cpp @@ -339,6 +339,9 @@ bool Tabs::onProcessMessage(JMessage msg) case JM_TIMER: { switch (m_ani) { + case ANI_NONE: + // Do nothing + break; case ANI_SCROLL: { int dir = jmanager_get_capture() == m_button_left ? -1: 1; setScrollX(m_scrollX + dir*8*msg->timer.count); diff --git a/third_party/tinyxml/tinyxmlparser.cpp b/third_party/tinyxml/tinyxmlparser.cpp index 9c91b4f94..abc761ec2 100644 --- a/third_party/tinyxml/tinyxmlparser.cpp +++ b/third_party/tinyxml/tinyxmlparser.cpp @@ -354,7 +354,7 @@ const char* TiXmlBase::SkipWhiteSpace( const char* p, TiXmlEncoding encoding ) } else { - while ( *p && IsWhiteSpace( *p ) || *p == '\n' || *p =='\r' ) + while ( ( *p && IsWhiteSpace( *p ) ) || *p == '\n' || *p =='\r' ) ++p; }