diff --git a/Makefile b/Makefile index dafe1559..953bbb8b 100644 --- a/Makefile +++ b/Makefile @@ -122,7 +122,7 @@ LOCAL_INCLUDE_PATHS = # specify the level of optimization that you desire # NONE, SOME, FULL -OPTIMIZE= +OPTIMIZE= FULL # specify here the codes for languages you are going # to support in this application. The default "en" @@ -143,7 +143,7 @@ DEFINES= # if unspecified default warnings will be used # NONE = supress all warnings # ALL = enable all warnings -WARNINGS = +WARNINGS = ALL # specify whether image symbols will be created # so that stack crawls in the debugger are meaningful @@ -156,7 +156,7 @@ SYMBOLS = DEBUGGER = # specify additional compiler flags for all files -COMPILER_FLAGS = +COMPILER_FLAGS = -Werror # specify additional linker flags LINKER_FLAGS = diff --git a/addons/AddOns/AdaptiveHistogramEqualization/Makefile b/addons/AddOns/AdaptiveHistogramEqualization/Makefile index 9fd1a218..fb91ebc4 100644 --- a/addons/AddOns/AdaptiveHistogramEqualization/Makefile +++ b/addons/AddOns/AdaptiveHistogramEqualization/Makefile @@ -92,7 +92,7 @@ LOCAL_INCLUDE_PATHS = ${Addon-Includes} # Specify the level of optimization that you want. Specify either NONE (O0), # SOME (O1), FULL (O2), or leave blank (for the default optimization level). -OPTIMIZE := +OPTIMIZE := FULL # Specify the codes for languages you are going to support in this # application. The default "en" one must be provided too. "make catkeys" @@ -110,7 +110,7 @@ DEFINES = # Specify the warning level. Either NONE (suppress all warnings), # ALL (enable all warnings), or leave blank (enable default warnings). -WARNINGS = +WARNINGS = ALL # With image symbols, stack crawls in the debugger are meaningful. # If set to "TRUE", symbols will be created. @@ -121,7 +121,7 @@ SYMBOLS := DEBUGGER := # Specify any additional compiler flags to be used. -COMPILER_FLAGS = +COMPILER_FLAGS = -Werror # Specify any additional linker flags to be used. LINKER_FLAGS = diff --git a/addons/AddOns/AntiDitherer/AntiDitherer.cpp b/addons/AddOns/AntiDitherer/AntiDitherer.cpp index 2c7ae949..6872b0bf 100644 --- a/addons/AddOns/AntiDitherer/AntiDitherer.cpp +++ b/addons/AddOns/AntiDitherer/AntiDitherer.cpp @@ -155,9 +155,6 @@ AntiDithererManipulator::anti_dither() if (selection != NULL && selection->IsEmpty() == false) bounds = selection->GetBoundingRect(); - int32 width = bounds.IntegerWidth(); - int32 height = bounds.IntegerHeight(); - float bounds_left = bounds.left; float bounds_right = bounds.right; float bounds_top = bounds.top; diff --git a/addons/AddOns/AntiDitherer/Makefile b/addons/AddOns/AntiDitherer/Makefile index 5cfb8006..cab663d3 100644 --- a/addons/AddOns/AntiDitherer/Makefile +++ b/addons/AddOns/AntiDitherer/Makefile @@ -92,7 +92,7 @@ LOCAL_INCLUDE_PATHS = ${Addon-Includes} # Specify the level of optimization that you want. Specify either NONE (O0), # SOME (O1), FULL (O2), or leave blank (for the default optimization level). -OPTIMIZE := +OPTIMIZE := FULL # Specify the codes for languages you are going to support in this # application. The default "en" one must be provided too. "make catkeys" @@ -110,7 +110,7 @@ DEFINES = # Specify the warning level. Either NONE (suppress all warnings), # ALL (enable all warnings), or leave blank (enable default warnings). -WARNINGS = +WARNINGS = ALL # With image symbols, stack crawls in the debugger are meaningful. # If set to "TRUE", symbols will be created. @@ -121,7 +121,7 @@ SYMBOLS := DEBUGGER := # Specify any additional compiler flags to be used. -COMPILER_FLAGS = +COMPILER_FLAGS = -Werror # Specify any additional linker flags to be used. LINKER_FLAGS = diff --git a/addons/AddOns/Blur/Blur.cpp b/addons/AddOns/Blur/Blur.cpp index cbedc28c..b71dbd3f 100644 --- a/addons/AddOns/Blur/Blur.cpp +++ b/addons/AddOns/Blur/Blur.cpp @@ -94,10 +94,6 @@ BlurManipulator::ManipulateBitmap( return NULL; } - BBitmap* source_bitmap; - BBitmap* target_bitmap; - BBitmap* new_bitmap = NULL; - return original; } diff --git a/addons/AddOns/Blur/Makefile b/addons/AddOns/Blur/Makefile index e83edad7..77fa011b 100644 --- a/addons/AddOns/Blur/Makefile +++ b/addons/AddOns/Blur/Makefile @@ -92,7 +92,7 @@ LOCAL_INCLUDE_PATHS = ${Addon-Includes} # Specify the level of optimization that you want. Specify either NONE (O0), # SOME (O1), FULL (O2), or leave blank (for the default optimization level). -OPTIMIZE := +OPTIMIZE := FULL # Specify the codes for languages you are going to support in this # application. The default "en" one must be provided too. "make catkeys" @@ -110,7 +110,7 @@ DEFINES = # Specify the warning level. Either NONE (suppress all warnings), # ALL (enable all warnings), or leave blank (enable default warnings). -WARNINGS = +WARNINGS = ALL # With image symbols, stack crawls in the debugger are meaningful. # If set to "TRUE", symbols will be created. @@ -121,7 +121,7 @@ SYMBOLS := DEBUGGER := # Specify any additional compiler flags to be used. -COMPILER_FLAGS = +COMPILER_FLAGS = -Werror # Specify any additional linker flags to be used. LINKER_FLAGS = diff --git a/addons/AddOns/Brightness/Brightness.cpp b/addons/AddOns/Brightness/Brightness.cpp index 12e697eb..4ee9864d 100644 --- a/addons/AddOns/Brightness/Brightness.cpp +++ b/addons/AddOns/Brightness/Brightness.cpp @@ -212,7 +212,6 @@ BrightnessManipulator::thread_function(int32 thread_number) float missed_update = 0; // Loop through all pixels in original. - uint32 sum; brightness *= 3; uint8 brighness_array[256]; for (int32 i = 0; i < 256; i++) diff --git a/addons/AddOns/Brightness/Makefile b/addons/AddOns/Brightness/Makefile index 03f0815c..bd3646c0 100644 --- a/addons/AddOns/Brightness/Makefile +++ b/addons/AddOns/Brightness/Makefile @@ -92,7 +92,7 @@ LOCAL_INCLUDE_PATHS = ${Addon-Includes} # Specify the level of optimization that you want. Specify either NONE (O0), # SOME (O1), FULL (O2), or leave blank (for the default optimization level). -OPTIMIZE := +OPTIMIZE := FULL # Specify the codes for languages you are going to support in this # application. The default "en" one must be provided too. "make catkeys" @@ -110,7 +110,7 @@ DEFINES = # Specify the warning level. Either NONE (suppress all warnings), # ALL (enable all warnings), or leave blank (enable default warnings). -WARNINGS = +WARNINGS = ALL # With image symbols, stack crawls in the debugger are meaningful. # If set to "TRUE", symbols will be created. @@ -121,7 +121,7 @@ SYMBOLS := DEBUGGER := # Specify any additional compiler flags to be used. -COMPILER_FLAGS = +COMPILER_FLAGS = -Werror # Specify any additional linker flags to be used. LINKER_FLAGS = diff --git a/addons/AddOns/ColorBalance/Makefile b/addons/AddOns/ColorBalance/Makefile index 4cb38acb..0bcfa249 100644 --- a/addons/AddOns/ColorBalance/Makefile +++ b/addons/AddOns/ColorBalance/Makefile @@ -92,7 +92,7 @@ LOCAL_INCLUDE_PATHS = ${Addon-Includes} # Specify the level of optimization that you want. Specify either NONE (O0), # SOME (O1), FULL (O2), or leave blank (for the default optimization level). -OPTIMIZE := +OPTIMIZE := FULL # Specify the codes for languages you are going to support in this # application. The default "en" one must be provided too. "make catkeys" @@ -110,7 +110,7 @@ DEFINES = # Specify the warning level. Either NONE (suppress all warnings), # ALL (enable all warnings), or leave blank (enable default warnings). -WARNINGS = +WARNINGS = ALL # With image symbols, stack crawls in the debugger are meaningful. # If set to "TRUE", symbols will be created. @@ -121,7 +121,7 @@ SYMBOLS := DEBUGGER := # Specify any additional compiler flags to be used. -COMPILER_FLAGS = +COMPILER_FLAGS = -Werror # Specify any additional linker flags to be used. LINKER_FLAGS = diff --git a/addons/AddOns/ColorReducer/Makefile b/addons/AddOns/ColorReducer/Makefile index c5f50c46..9dd0cd4c 100644 --- a/addons/AddOns/ColorReducer/Makefile +++ b/addons/AddOns/ColorReducer/Makefile @@ -94,7 +94,7 @@ LOCAL_INCLUDE_PATHS = ${Addon-Includes} # Specify the level of optimization that you want. Specify either NONE (O0), # SOME (O1), FULL (O2), or leave blank (for the default optimization level). -OPTIMIZE := +OPTIMIZE := FULL # Specify the codes for languages you are going to support in this # application. The default "en" one must be provided too. "make catkeys" @@ -112,7 +112,7 @@ DEFINES = # Specify the warning level. Either NONE (suppress all warnings), # ALL (enable all warnings), or leave blank (enable default warnings). -WARNINGS = +WARNINGS = ALL # With image symbols, stack crawls in the debugger are meaningful. # If set to "TRUE", symbols will be created. @@ -123,7 +123,7 @@ SYMBOLS := DEBUGGER := # Specify any additional compiler flags to be used. -COMPILER_FLAGS = +COMPILER_FLAGS = -Werror # Specify any additional linker flags to be used. LINKER_FLAGS = diff --git a/addons/AddOns/ColorReducer/color_mapper.cpp b/addons/AddOns/ColorReducer/color_mapper.cpp index b6ea3456..6a021f62 100644 --- a/addons/AddOns/ColorReducer/color_mapper.cpp +++ b/addons/AddOns/ColorReducer/color_mapper.cpp @@ -218,9 +218,6 @@ preserve_solids_fs_color_mapper(BBitmap* inSource, const rgb_color* inPalette, i int32 width = inSource->Bounds().IntegerWidth(); int32 height = inSource->Bounds().IntegerHeight(); - int32 source_padding = source_bpr - width - 1; - int32 destination_padding = destination_bpr - width - 1; - // We use three error arrays and three side error variables. // The error arrays are a little bit wider than the image to // avoid cheking for border conditions diff --git a/addons/AddOns/ColorReducer/palette_generator.cpp b/addons/AddOns/ColorReducer/palette_generator.cpp index 970bf7c2..076f2071 100644 --- a/addons/AddOns/ColorReducer/palette_generator.cpp +++ b/addons/AddOns/ColorReducer/palette_generator.cpp @@ -122,7 +122,7 @@ gla_palette(BBitmap* inBitmap, int paletteSize) list_count++; } } - printf("Number of lists is %d, average length %f\n", list_count, + printf("Number of lists is %" B_PRId32 ", average length %f\n", list_count, total_length / (float)list_count); // Initialize the palette. @@ -218,7 +218,7 @@ gla_palette(BBitmap* inBitmap, int paletteSize) palette_still_improving = true; } - printf("Number of iterations %d\n", number_of_iterations); + printf("Number of iterations %" B_PRId32 "\n", number_of_iterations); delete[] previous_palette; delete color_metric; diff --git a/addons/AddOns/ColorSeparator/Makefile b/addons/AddOns/ColorSeparator/Makefile index a45276e0..2f8dfe0e 100644 --- a/addons/AddOns/ColorSeparator/Makefile +++ b/addons/AddOns/ColorSeparator/Makefile @@ -92,7 +92,7 @@ LOCAL_INCLUDE_PATHS = ${Addon-Includes} # Specify the level of optimization that you want. Specify either NONE (O0), # SOME (O1), FULL (O2), or leave blank (for the default optimization level). -OPTIMIZE := +OPTIMIZE := FULL # Specify the codes for languages you are going to support in this # application. The default "en" one must be provided too. "make catkeys" @@ -110,7 +110,7 @@ DEFINES = # Specify the warning level. Either NONE (suppress all warnings), # ALL (enable all warnings), or leave blank (enable default warnings). -WARNINGS = +WARNINGS = ALL # With image symbols, stack crawls in the debugger are meaningful. # If set to "TRUE", symbols will be created. @@ -121,7 +121,7 @@ SYMBOLS := DEBUGGER := # Specify any additional compiler flags to be used. -COMPILER_FLAGS = +COMPILER_FLAGS = -Werror # Specify any additional linker flags to be used. LINKER_FLAGS = diff --git a/addons/AddOns/Contrast/Contrast.cpp b/addons/AddOns/Contrast/Contrast.cpp index 602ac2a8..59aee107 100644 --- a/addons/AddOns/Contrast/Contrast.cpp +++ b/addons/AddOns/Contrast/Contrast.cpp @@ -147,7 +147,7 @@ ContrastManipulator::CalculateAverageLuminance(BBitmap* bitmap) uint32 word; } color; - for (int32 i = 0; i < bits_length; i++) { + for (uint32 i = 0; i < bits_length; i++) { color.word = *bits++; luminance_sum += 0.299 * color.bytes[0] + 0.587 * color.bytes[1] + 0.144 * color.bytes[2]; } @@ -245,7 +245,6 @@ ContrastManipulator::thread_function(int32 thread_number) float missed_update = 0; // Loop through all pixels in original. - uint32 sum; contrast *= 3; for (int32 y = top; y <= bottom; y += step) { int32 y_times_source_bpr = y * source_bpr; diff --git a/addons/AddOns/Contrast/Makefile b/addons/AddOns/Contrast/Makefile index 9b443a38..deadf36c 100644 --- a/addons/AddOns/Contrast/Makefile +++ b/addons/AddOns/Contrast/Makefile @@ -92,7 +92,7 @@ LOCAL_INCLUDE_PATHS = ${Addon-Includes} # Specify the level of optimization that you want. Specify either NONE (O0), # SOME (O1), FULL (O2), or leave blank (for the default optimization level). -OPTIMIZE := +OPTIMIZE := FULL # Specify the codes for languages you are going to support in this # application. The default "en" one must be provided too. "make catkeys" @@ -110,7 +110,7 @@ DEFINES = # Specify the warning level. Either NONE (suppress all warnings), # ALL (enable all warnings), or leave blank (enable default warnings). -WARNINGS = +WARNINGS = ALL # With image symbols, stack crawls in the debugger are meaningful. # If set to "TRUE", symbols will be created. @@ -121,7 +121,7 @@ SYMBOLS := DEBUGGER := # Specify any additional compiler flags to be used. -COMPILER_FLAGS = +COMPILER_FLAGS = -Werror # Specify any additional linker flags to be used. LINKER_FLAGS = diff --git a/addons/AddOns/ContrastManipulator/Makefile b/addons/AddOns/ContrastManipulator/Makefile index 4907e7f0..3379e8b3 100644 --- a/addons/AddOns/ContrastManipulator/Makefile +++ b/addons/AddOns/ContrastManipulator/Makefile @@ -92,7 +92,7 @@ LOCAL_INCLUDE_PATHS = ${Addon-Includes} # Specify the level of optimization that you want. Specify either NONE (O0), # SOME (O1), FULL (O2), or leave blank (for the default optimization level). -OPTIMIZE := +OPTIMIZE := FULL # Specify the codes for languages you are going to support in this # application. The default "en" one must be provided too. "make catkeys" @@ -110,7 +110,7 @@ DEFINES = # Specify the warning level. Either NONE (suppress all warnings), # ALL (enable all warnings), or leave blank (enable default warnings). -WARNINGS = +WARNINGS = ALL # With image symbols, stack crawls in the debugger are meaningful. # If set to "TRUE", symbols will be created. @@ -121,7 +121,7 @@ SYMBOLS := DEBUGGER := # Specify any additional compiler flags to be used. -COMPILER_FLAGS = +COMPILER_FLAGS = -Werror # Specify any additional linker flags to be used. LINKER_FLAGS = diff --git a/addons/AddOns/Dispersion/Makefile b/addons/AddOns/Dispersion/Makefile index 05b8f8a6..c754c77d 100644 --- a/addons/AddOns/Dispersion/Makefile +++ b/addons/AddOns/Dispersion/Makefile @@ -93,7 +93,7 @@ LOCAL_INCLUDE_PATHS = ${Addon-Includes} # Specify the level of optimization that you want. Specify either NONE (O0), # SOME (O1), FULL (O2), or leave blank (for the default optimization level). -OPTIMIZE := +OPTIMIZE := FULL # Specify the codes for languages you are going to support in this # application. The default "en" one must be provided too. "make catkeys" @@ -111,7 +111,7 @@ DEFINES = # Specify the warning level. Either NONE (suppress all warnings), # ALL (enable all warnings), or leave blank (enable default warnings). -WARNINGS = +WARNINGS = ALL # With image symbols, stack crawls in the debugger are meaningful. # If set to "TRUE", symbols will be created. @@ -122,7 +122,7 @@ SYMBOLS := DEBUGGER := # Specify any additional compiler flags to be used. -COMPILER_FLAGS = +COMPILER_FLAGS = -Werror # Specify any additional linker flags to be used. LINKER_FLAGS = diff --git a/addons/AddOns/EdgeDetector/DetectEdges.cpp b/addons/AddOns/EdgeDetector/DetectEdges.cpp index bcaa1409..4e66e4cf 100644 --- a/addons/AddOns/EdgeDetector/DetectEdges.cpp +++ b/addons/AddOns/EdgeDetector/DetectEdges.cpp @@ -69,7 +69,7 @@ DetectEdgesManipulator::ManipulateBitmap(BBitmap* original, BStatusBar* status_b // convolution to work properly. duplicate = DuplicateBitmap(original, -1); } - catch (std::bad_alloc e) { + catch (const std::bad_alloc& e) { // Here we could clean up if there was need for that. return NULL; // Returning NULL means that the image did not change. } diff --git a/addons/AddOns/EdgeDetector/Makefile b/addons/AddOns/EdgeDetector/Makefile index 6fc49e65..74f58af2 100644 --- a/addons/AddOns/EdgeDetector/Makefile +++ b/addons/AddOns/EdgeDetector/Makefile @@ -92,7 +92,7 @@ LOCAL_INCLUDE_PATHS = ${Addon-Includes} # Specify the level of optimization that you want. Specify either NONE (O0), # SOME (O1), FULL (O2), or leave blank (for the default optimization level). -OPTIMIZE := +OPTIMIZE := FULL # Specify the codes for languages you are going to support in this # application. The default "en" one must be provided too. "make catkeys" @@ -110,7 +110,7 @@ DEFINES = # Specify the warning level. Either NONE (suppress all warnings), # ALL (enable all warnings), or leave blank (enable default warnings). -WARNINGS = +WARNINGS = ALL # With image symbols, stack crawls in the debugger are meaningful. # If set to "TRUE", symbols will be created. @@ -121,7 +121,7 @@ SYMBOLS := DEBUGGER := # Specify any additional compiler flags to be used. -COMPILER_FLAGS = +COMPILER_FLAGS = -Werror # Specify any additional linker flags to be used. LINKER_FLAGS = diff --git a/addons/AddOns/Emboss/EmbossAddOn.cpp b/addons/AddOns/Emboss/EmbossAddOn.cpp index 03568cd9..809b036f 100644 --- a/addons/AddOns/Emboss/EmbossAddOn.cpp +++ b/addons/AddOns/Emboss/EmbossAddOn.cpp @@ -92,8 +92,6 @@ EmbossManipulator::ManipulateBitmap(BBitmap* original, BStatusBar* progress_view // here we can start doing the actual convolution spare_bits += spare_bpr + 1; - int32 target_value; - BMessage progress_message = BMessage(B_UPDATE_STATUS_BAR); progress_message.AddFloat("delta", 0.0); diff --git a/addons/AddOns/Emboss/Makefile b/addons/AddOns/Emboss/Makefile index 93fc525a..f69a0d67 100644 --- a/addons/AddOns/Emboss/Makefile +++ b/addons/AddOns/Emboss/Makefile @@ -92,7 +92,7 @@ LOCAL_INCLUDE_PATHS = ${Addon-Includes} # Specify the level of optimization that you want. Specify either NONE (O0), # SOME (O1), FULL (O2), or leave blank (for the default optimization level). -OPTIMIZE := +OPTIMIZE := FULL # Specify the codes for languages you are going to support in this # application. The default "en" one must be provided too. "make catkeys" @@ -110,7 +110,7 @@ DEFINES = # Specify the warning level. Either NONE (suppress all warnings), # ALL (enable all warnings), or leave blank (enable default warnings). -WARNINGS = +WARNINGS = ALL # With image symbols, stack crawls in the debugger are meaningful. # If set to "TRUE", symbols will be created. @@ -121,7 +121,7 @@ SYMBOLS := DEBUGGER := # Specify any additional compiler flags to be used. -COMPILER_FLAGS = +COMPILER_FLAGS = -Werror # Specify any additional linker flags to be used. LINKER_FLAGS = diff --git a/addons/AddOns/EnhanceEdges/EnhanceEdges.cpp b/addons/AddOns/EnhanceEdges/EnhanceEdges.cpp index e74f26db..faaeca96 100644 --- a/addons/AddOns/EnhanceEdges/EnhanceEdges.cpp +++ b/addons/AddOns/EnhanceEdges/EnhanceEdges.cpp @@ -75,7 +75,7 @@ EnhanceEdgesManipulator::ManipulateBitmap(BBitmap* original, BStatusBar* status_ // convolution to work properly. duplicate = DuplicateBitmap(original, -1); } - catch (std::bad_alloc e) { + catch (const std::bad_alloc& e) { // Here we could clean up if there was need for that. return NULL; // Returning NULL means that the image did not change. } diff --git a/addons/AddOns/EnhanceEdges/Makefile b/addons/AddOns/EnhanceEdges/Makefile index ae89883a..d3b6a584 100644 --- a/addons/AddOns/EnhanceEdges/Makefile +++ b/addons/AddOns/EnhanceEdges/Makefile @@ -92,7 +92,7 @@ LOCAL_INCLUDE_PATHS = ${Addon-Includes} # Specify the level of optimization that you want. Specify either NONE (O0), # SOME (O1), FULL (O2), or leave blank (for the default optimization level). -OPTIMIZE := +OPTIMIZE := FULL # Specify the codes for languages you are going to support in this # application. The default "en" one must be provided too. "make catkeys" @@ -110,7 +110,7 @@ DEFINES = # Specify the warning level. Either NONE (suppress all warnings), # ALL (enable all warnings), or leave blank (enable default warnings). -WARNINGS = +WARNINGS = ALL # With image symbols, stack crawls in the debugger are meaningful. # If set to "TRUE", symbols will be created. @@ -121,7 +121,7 @@ SYMBOLS := DEBUGGER := # Specify any additional compiler flags to be used. -COMPILER_FLAGS = +COMPILER_FLAGS = -Werror # Specify any additional linker flags to be used. LINKER_FLAGS = diff --git a/addons/AddOns/GaussianBlur/Makefile b/addons/AddOns/GaussianBlur/Makefile index a4ce1fdb..4ff177b4 100644 --- a/addons/AddOns/GaussianBlur/Makefile +++ b/addons/AddOns/GaussianBlur/Makefile @@ -92,7 +92,7 @@ LOCAL_INCLUDE_PATHS = ${Addon-Includes} # Specify the level of optimization that you want. Specify either NONE (O0), # SOME (O1), FULL (O2), or leave blank (for the default optimization level). -OPTIMIZE := +OPTIMIZE := FULL # Specify the codes for languages you are going to support in this # application. The default "en" one must be provided too. "make catkeys" @@ -110,7 +110,7 @@ DEFINES = # Specify the warning level. Either NONE (suppress all warnings), # ALL (enable all warnings), or leave blank (enable default warnings). -WARNINGS = +WARNINGS = ALL # With image symbols, stack crawls in the debugger are meaningful. # If set to "TRUE", symbols will be created. @@ -121,7 +121,7 @@ SYMBOLS := DEBUGGER := # Specify any additional compiler flags to be used. -COMPILER_FLAGS = +COMPILER_FLAGS = -Werror # Specify any additional linker flags to be used. LINKER_FLAGS = diff --git a/addons/AddOns/Grayscale/Makefile b/addons/AddOns/Grayscale/Makefile index f11ca06d..30828d20 100644 --- a/addons/AddOns/Grayscale/Makefile +++ b/addons/AddOns/Grayscale/Makefile @@ -92,7 +92,7 @@ LOCAL_INCLUDE_PATHS = ${Addon-Includes} # Specify the level of optimization that you want. Specify either NONE (O0), # SOME (O1), FULL (O2), or leave blank (for the default optimization level). -OPTIMIZE := +OPTIMIZE := FULL # Specify the codes for languages you are going to support in this # application. The default "en" one must be provided too. "make catkeys" @@ -110,7 +110,7 @@ DEFINES = # Specify the warning level. Either NONE (suppress all warnings), # ALL (enable all warnings), or leave blank (enable default warnings). -WARNINGS = +WARNINGS = ALL # With image symbols, stack crawls in the debugger are meaningful. # If set to "TRUE", symbols will be created. @@ -121,7 +121,7 @@ SYMBOLS := DEBUGGER := # Specify any additional compiler flags to be used. -COMPILER_FLAGS = +COMPILER_FLAGS = -Werror # Specify any additional linker flags to be used. LINKER_FLAGS = diff --git a/addons/AddOns/Halftone/Halftone.cpp b/addons/AddOns/Halftone/Halftone.cpp index 2d4cd218..0ee68af5 100644 --- a/addons/AddOns/Halftone/Halftone.cpp +++ b/addons/AddOns/Halftone/Halftone.cpp @@ -244,7 +244,6 @@ Halftone::round_dot_halftone(BBitmap* original, Selection* selection, BStatusBar int32 b = min_c(y + round_dot_size, bottom); uint32* s_delta_bits; - int32 number_of_pixels = 0; for (int32 dy = y; dy < b; dy++) { s_delta_bits = source_bits + dy * source_bpr + x; for (int32 dx = x; dx < r; dx++) { @@ -253,7 +252,7 @@ Halftone::round_dot_halftone(BBitmap* original, Selection* selection, BStatusBar = color.bytes[0] * .114 + color.bytes[1] * .587 + color.bytes[2] * .299; - int threshold = luminance * normalizer; + uint threshold = luminance * normalizer; *s_delta_bits++ = (round_dot_pattern[dy - y][dx - x] > threshold ? c1.word : c2.word); } @@ -269,7 +268,6 @@ Halftone::round_dot_halftone(BBitmap* original, Selection* selection, BStatusBar int32 b = min_c(y + round_dot_size, bottom); uint32* s_delta_bits; - int32 number_of_pixels = 0; for (int32 dy = y; dy < b; dy++) { s_delta_bits = source_bits + dy * source_bpr + x; for (int32 dx = x; dx < r; dx++) { @@ -279,7 +277,7 @@ Halftone::round_dot_halftone(BBitmap* original, Selection* selection, BStatusBar = color.bytes[0] * .114 + color.bytes[1] * .587 + color.bytes[2] * .299; - int threshold = luminance * normalizer; + uint threshold = luminance * normalizer; *s_delta_bits = (round_dot_pattern[dy - y][dx - x] > threshold ? c1.word : c2.word); } @@ -334,7 +332,6 @@ Halftone::diagonal_line_halftone(BBitmap* original, Selection* selection, BStatu int32 b = min_c(y + diagonal_line_size, bottom); uint32* s_delta_bits; - int32 number_of_pixels = 0; for (int32 dy = y; dy < b; dy++) { s_delta_bits = source_bits + dy * source_bpr + x; for (int32 dx = x; dx < r; dx++) { @@ -343,7 +340,7 @@ Halftone::diagonal_line_halftone(BBitmap* original, Selection* selection, BStatu = color.bytes[0] * .114 + color.bytes[1] * .587 + color.bytes[2] * .299; - int threshold = luminance * normalizer; + uint threshold = luminance * normalizer; *s_delta_bits++ = (diagonal_line_pattern[dy - y][dx - x] > threshold ? c1.word : c2.word); } @@ -359,7 +356,6 @@ Halftone::diagonal_line_halftone(BBitmap* original, Selection* selection, BStatu int32 b = min_c(y + diagonal_line_size, bottom); uint32* s_delta_bits; - int32 number_of_pixels = 0; for (int32 dy = y; dy < b; dy++) { s_delta_bits = source_bits + dy * source_bpr + x; for (int32 dx = x; dx < r; dx++) { @@ -369,7 +365,7 @@ Halftone::diagonal_line_halftone(BBitmap* original, Selection* selection, BStatu = color.bytes[0] * .114 + color.bytes[1] * .587 + color.bytes[2] * .299; - int threshold = luminance * normalizer; + uint threshold = luminance * normalizer; *s_delta_bits = (diagonal_line_pattern[dy - y][dx - x] > threshold ? c1.word : c2.word); } @@ -424,7 +420,6 @@ Halftone::ordered_dither_halftone(BBitmap* original, Selection* selection, BStat int32 b = min_c(y + ordered_matrix_size, bottom); uint32* s_delta_bits; - int32 number_of_pixels = 0; for (int32 dy = y; dy < b; dy++) { s_delta_bits = source_bits + dy * source_bpr + x; for (int32 dx = x; dx < r; dx++) { @@ -433,7 +428,7 @@ Halftone::ordered_dither_halftone(BBitmap* original, Selection* selection, BStat = color.bytes[0] * .114 + color.bytes[1] * .587 + color.bytes[2] * .299; - int threshold = luminance * normalizer; + uint threshold = luminance * normalizer; *s_delta_bits++ = (ordered_matrix[dy - y][dx - x] > threshold ? c1.word : c2.word); } @@ -449,7 +444,6 @@ Halftone::ordered_dither_halftone(BBitmap* original, Selection* selection, BStat int32 b = min_c(y + ordered_matrix_size, bottom); uint32* s_delta_bits; - int32 number_of_pixels = 0; for (int32 dy = y; dy < b; dy++) { s_delta_bits = source_bits + dy * source_bpr + x; for (int32 dx = x; dx < r; dx++) { @@ -459,7 +453,7 @@ Halftone::ordered_dither_halftone(BBitmap* original, Selection* selection, BStat = color.bytes[0] * .114 + color.bytes[1] * .587 + color.bytes[2] * .299; - int threshold = luminance * normalizer; + uint threshold = luminance * normalizer; *s_delta_bits = (ordered_matrix[dy - y][dx - x] > threshold ? c1.word : c2.word); } @@ -545,7 +539,6 @@ Halftone::fs_dither_halftone(BBitmap* original, Selection* selection, BStatusBar int32 b = min_c(y + ordered_matrix_size, bottom); uint32* s_delta_bits; - int32 number_of_pixels = 0; for (int32 dy = y; dy < b; dy++) { s_delta_bits = source_bits + dy * source_bpr + x; for (int32 dx = x; dx < r; dx++) { @@ -555,7 +548,7 @@ Halftone::fs_dither_halftone(BBitmap* original, Selection* selection, BStatusBar = color.bytes[0] * .114 + color.bytes[1] * .587 + color.bytes[2] * .299; - int threshold = luminance * normalizer; + uint threshold = luminance * normalizer; *s_delta_bits = (ordered_matrix[dy - y][dx - x] > threshold ? c1.word : c2.word); } @@ -592,8 +585,6 @@ Halftone::ncandidate_dither_halftone( for (int32 i = 0; i < right - left + 3; i++) errors[i] = 0; - float right_error = 0; - union { uint8 bytes[4]; uint32 word; @@ -640,7 +631,6 @@ Halftone::ncandidate_dither_halftone( int32 b = min_c(y + ordered_matrix_size, bottom); uint32* s_delta_bits; - int32 number_of_pixels = 0; for (int32 dy = y; dy < b; dy++) { s_delta_bits = source_bits + dy * source_bpr + x; for (int32 dx = x; dx < r; dx++) { @@ -650,7 +640,7 @@ Halftone::ncandidate_dither_halftone( = color.bytes[0] * .114 + color.bytes[1] * .587 + color.bytes[2] * .299; - int threshold = luminance * normalizer; + uint threshold = luminance * normalizer; *s_delta_bits = (ordered_matrix[dy - y][dx - x] > threshold ? c1.word : c2.word); } diff --git a/addons/AddOns/Halftone/Makefile b/addons/AddOns/Halftone/Makefile index bc29babb..326de48e 100644 --- a/addons/AddOns/Halftone/Makefile +++ b/addons/AddOns/Halftone/Makefile @@ -92,7 +92,7 @@ LOCAL_INCLUDE_PATHS = ${Addon-Includes} # Specify the level of optimization that you want. Specify either NONE (O0), # SOME (O1), FULL (O2), or leave blank (for the default optimization level). -OPTIMIZE := +OPTIMIZE := FULL # Specify the codes for languages you are going to support in this # application. The default "en" one must be provided too. "make catkeys" @@ -110,7 +110,7 @@ DEFINES = # Specify the warning level. Either NONE (suppress all warnings), # ALL (enable all warnings), or leave blank (enable default warnings). -WARNINGS = +WARNINGS = ALL # With image symbols, stack crawls in the debugger are meaningful. # If set to "TRUE", symbols will be created. @@ -121,7 +121,7 @@ SYMBOLS := DEBUGGER := # Specify any additional compiler flags to be used. -COMPILER_FLAGS = +COMPILER_FLAGS = -Werror # Specify any additional linker flags to be used. LINKER_FLAGS = diff --git a/addons/AddOns/Interference/Makefile b/addons/AddOns/Interference/Makefile index c53f0744..91d4b9c6 100644 --- a/addons/AddOns/Interference/Makefile +++ b/addons/AddOns/Interference/Makefile @@ -93,7 +93,7 @@ LOCAL_INCLUDE_PATHS = ${Addon-Includes} # Specify the level of optimization that you want. Specify either NONE (O0), # SOME (O1), FULL (O2), or leave blank (for the default optimization level). -OPTIMIZE := +OPTIMIZE := FULL # Specify the codes for languages you are going to support in this # application. The default "en" one must be provided too. "make catkeys" @@ -111,7 +111,7 @@ DEFINES = # Specify the warning level. Either NONE (suppress all warnings), # ALL (enable all warnings), or leave blank (enable default warnings). -WARNINGS = +WARNINGS = ALL # With image symbols, stack crawls in the debugger are meaningful. # If set to "TRUE", symbols will be created. @@ -122,7 +122,7 @@ SYMBOLS := DEBUGGER := # Specify any additional compiler flags to be used. -COMPILER_FLAGS = +COMPILER_FLAGS = -Werror # Specify any additional linker flags to be used. LINKER_FLAGS = diff --git a/addons/AddOns/MarbleTexturer/Makefile b/addons/AddOns/MarbleTexturer/Makefile index a97356ec..5d76ce86 100644 --- a/addons/AddOns/MarbleTexturer/Makefile +++ b/addons/AddOns/MarbleTexturer/Makefile @@ -93,7 +93,7 @@ LOCAL_INCLUDE_PATHS = ${Addon-Includes} # Specify the level of optimization that you want. Specify either NONE (O0), # SOME (O1), FULL (O2), or leave blank (for the default optimization level). -OPTIMIZE := +OPTIMIZE := FULL # Specify the codes for languages you are going to support in this # application. The default "en" one must be provided too. "make catkeys" @@ -111,7 +111,7 @@ DEFINES = # Specify the warning level. Either NONE (suppress all warnings), # ALL (enable all warnings), or leave blank (enable default warnings). -WARNINGS = +WARNINGS = ALL # With image symbols, stack crawls in the debugger are meaningful. # If set to "TRUE", symbols will be created. @@ -122,7 +122,7 @@ SYMBOLS := DEBUGGER := # Specify any additional compiler flags to be used. -COMPILER_FLAGS = +COMPILER_FLAGS = -Werror # Specify any additional linker flags to be used. LINKER_FLAGS = diff --git a/addons/AddOns/MarbleTexturer/Marble.cpp b/addons/AddOns/MarbleTexturer/Marble.cpp index 04c2f030..ebff3ae2 100644 --- a/addons/AddOns/MarbleTexturer/Marble.cpp +++ b/addons/AddOns/MarbleTexturer/Marble.cpp @@ -154,7 +154,6 @@ MarbleManipulator::thread_function(int32 thread_number) // Loop through all pixels in original. float one_per_width = 1.0 / 128; float one_per_height = 1.0 / 128; - float one_per_depth = 1.0 / 1024; source += (int32)top * source_bpr; for (float y = top; y <= bottom; ++y) { @@ -201,7 +200,6 @@ MarbleManipulator::thread_function(int32 thread_number) // Loop through all pixels in original. float one_per_width = 1.0 / 128; float one_per_height = 1.0 / 128; - float one_per_depth = 1.0 / 1024; // Loop through all pixels in original. for (int32 y = top; y <= bottom; ++y) { diff --git a/addons/AddOns/Negative/Makefile b/addons/AddOns/Negative/Makefile index cef801b5..4b552785 100644 --- a/addons/AddOns/Negative/Makefile +++ b/addons/AddOns/Negative/Makefile @@ -92,7 +92,7 @@ LOCAL_INCLUDE_PATHS = ${Addon-Includes} # Specify the level of optimization that you want. Specify either NONE (O0), # SOME (O1), FULL (O2), or leave blank (for the default optimization level). -OPTIMIZE := +OPTIMIZE := FULL # Specify the codes for languages you are going to support in this # application. The default "en" one must be provided too. "make catkeys" @@ -110,7 +110,7 @@ DEFINES = # Specify the warning level. Either NONE (suppress all warnings), # ALL (enable all warnings), or leave blank (enable default warnings). -WARNINGS = +WARNINGS = ALL # With image symbols, stack crawls in the debugger are meaningful. # If set to "TRUE", symbols will be created. @@ -121,7 +121,7 @@ SYMBOLS := DEBUGGER := # Specify any additional compiler flags to be used. -COMPILER_FLAGS = +COMPILER_FLAGS = -Werror # Specify any additional linker flags to be used. LINKER_FLAGS = diff --git a/addons/AddOns/Oil/Makefile b/addons/AddOns/Oil/Makefile index 3f18b2df..b042bd55 100644 --- a/addons/AddOns/Oil/Makefile +++ b/addons/AddOns/Oil/Makefile @@ -93,7 +93,7 @@ LOCAL_INCLUDE_PATHS = ${Addon-Includes} # Specify the level of optimization that you want. Specify either NONE (O0), # SOME (O1), FULL (O2), or leave blank (for the default optimization level). -OPTIMIZE := +OPTIMIZE := FULL # Specify the codes for languages you are going to support in this # application. The default "en" one must be provided too. "make catkeys" @@ -111,7 +111,7 @@ DEFINES = # Specify the warning level. Either NONE (suppress all warnings), # ALL (enable all warnings), or leave blank (enable default warnings). -WARNINGS = +WARNINGS = ALL # With image symbols, stack crawls in the debugger are meaningful. # If set to "TRUE", symbols will be created. @@ -122,7 +122,7 @@ SYMBOLS := DEBUGGER := # Specify any additional compiler flags to be used. -COMPILER_FLAGS = +COMPILER_FLAGS = -Werror # Specify any additional linker flags to be used. LINKER_FLAGS = diff --git a/addons/AddOns/Oil/OilAddOn.cpp b/addons/AddOns/Oil/OilAddOn.cpp index e6fc2c31..649264a1 100644 --- a/addons/AddOns/Oil/OilAddOn.cpp +++ b/addons/AddOns/Oil/OilAddOn.cpp @@ -58,7 +58,6 @@ OilManipulator::ManipulateBitmap(BBitmap* original, BStatusBar* status_bar) if (status_bar != NULL) status_bar_window = status_bar->Window(); - BRect a_rect = original->Bounds(); BBitmap* spare_buffer = DuplicateBitmap(original); BitmapDrawer* target = new BitmapDrawer(original); diff --git a/addons/AddOns/PolarMapper/Makefile b/addons/AddOns/PolarMapper/Makefile index 847f0db7..acda91df 100644 --- a/addons/AddOns/PolarMapper/Makefile +++ b/addons/AddOns/PolarMapper/Makefile @@ -92,7 +92,7 @@ LOCAL_INCLUDE_PATHS = ${Addon-Includes} # Specify the level of optimization that you want. Specify either NONE (O0), # SOME (O1), FULL (O2), or leave blank (for the default optimization level). -OPTIMIZE := +OPTIMIZE := FULL # Specify the codes for languages you are going to support in this # application. The default "en" one must be provided too. "make catkeys" @@ -110,7 +110,7 @@ DEFINES = # Specify the warning level. Either NONE (suppress all warnings), # ALL (enable all warnings), or leave blank (enable default warnings). -WARNINGS = +WARNINGS = ALL # With image symbols, stack crawls in the debugger are meaningful. # If set to "TRUE", symbols will be created. @@ -121,7 +121,7 @@ SYMBOLS := DEBUGGER := # Specify any additional compiler flags to be used. -COMPILER_FLAGS = +COMPILER_FLAGS = -Werror # Specify any additional linker flags to be used. LINKER_FLAGS = diff --git a/addons/AddOns/Saturation/Makefile b/addons/AddOns/Saturation/Makefile index 59f18c89..55f67a2f 100644 --- a/addons/AddOns/Saturation/Makefile +++ b/addons/AddOns/Saturation/Makefile @@ -92,7 +92,7 @@ LOCAL_INCLUDE_PATHS = ${Addon-Includes} # Specify the level of optimization that you want. Specify either NONE (O0), # SOME (O1), FULL (O2), or leave blank (for the default optimization level). -OPTIMIZE := +OPTIMIZE := FULL # Specify the codes for languages you are going to support in this # application. The default "en" one must be provided too. "make catkeys" @@ -110,7 +110,7 @@ DEFINES = # Specify the warning level. Either NONE (suppress all warnings), # ALL (enable all warnings), or leave blank (enable default warnings). -WARNINGS = +WARNINGS = ALL # With image symbols, stack crawls in the debugger are meaningful. # If set to "TRUE", symbols will be created. @@ -121,7 +121,7 @@ SYMBOLS := DEBUGGER := # Specify any additional compiler flags to be used. -COMPILER_FLAGS = +COMPILER_FLAGS = -Werror # Specify any additional linker flags to be used. LINKER_FLAGS = diff --git a/addons/AddOns/Saturation/Saturation.cpp b/addons/AddOns/Saturation/Saturation.cpp index d0fff585..f8095399 100644 --- a/addons/AddOns/Saturation/Saturation.cpp +++ b/addons/AddOns/Saturation/Saturation.cpp @@ -251,7 +251,6 @@ SaturationManipulator::thread_function(int32 thread_number) float missed_update = 0; // Loop through all pixels in original. - uint32 sum; saturation *= 3; for (int32 y = top; y <= bottom; y += step) { int32 y_times_source_bpr = y * source_bpr; diff --git a/addons/AddOns/Sharpness/Makefile b/addons/AddOns/Sharpness/Makefile index f33261fc..44cb1842 100644 --- a/addons/AddOns/Sharpness/Makefile +++ b/addons/AddOns/Sharpness/Makefile @@ -92,7 +92,7 @@ LOCAL_INCLUDE_PATHS = ${Addon-Includes} # Specify the level of optimization that you want. Specify either NONE (O0), # SOME (O1), FULL (O2), or leave blank (for the default optimization level). -OPTIMIZE := +OPTIMIZE := FULL # Specify the codes for languages you are going to support in this # application. The default "en" one must be provided too. "make catkeys" @@ -110,7 +110,7 @@ DEFINES = # Specify the warning level. Either NONE (suppress all warnings), # ALL (enable all warnings), or leave blank (enable default warnings). -WARNINGS = +WARNINGS = ALL # With image symbols, stack crawls in the debugger are meaningful. # If set to "TRUE", symbols will be created. @@ -121,7 +121,7 @@ SYMBOLS := DEBUGGER := # Specify any additional compiler flags to be used. -COMPILER_FLAGS = +COMPILER_FLAGS = -Werror # Specify any additional linker flags to be used. LINKER_FLAGS = diff --git a/addons/AddOns/Sharpness/Sharpness.cpp b/addons/AddOns/Sharpness/Sharpness.cpp index d9138263..b76a9260 100644 --- a/addons/AddOns/Sharpness/Sharpness.cpp +++ b/addons/AddOns/Sharpness/Sharpness.cpp @@ -235,7 +235,6 @@ SharpnessManipulator::thread_function(int32 thread_number) float missed_update = 0; // Loop through all pixels in original. - uint32 sum; for (int32 y = top; y <= bottom; y += step) { int32 y_times_source_bpr = y * source_bpr; int32 y_times_target_bpr = y * target_bpr; diff --git a/addons/AddOns/Threshold/Makefile b/addons/AddOns/Threshold/Makefile index 56aa03f3..7f70f8a9 100644 --- a/addons/AddOns/Threshold/Makefile +++ b/addons/AddOns/Threshold/Makefile @@ -93,7 +93,7 @@ LOCAL_INCLUDE_PATHS = ${Addon-Includes} # Specify the level of optimization that you want. Specify either NONE (O0), # SOME (O1), FULL (O2), or leave blank (for the default optimization level). -OPTIMIZE := +OPTIMIZE := FULL # Specify the codes for languages you are going to support in this # application. The default "en" one must be provided too. "make catkeys" @@ -111,7 +111,7 @@ DEFINES = # Specify the warning level. Either NONE (suppress all warnings), # ALL (enable all warnings), or leave blank (enable default warnings). -WARNINGS = +WARNINGS = ALL # With image symbols, stack crawls in the debugger are meaningful. # If set to "TRUE", symbols will be created. @@ -122,7 +122,7 @@ SYMBOLS := DEBUGGER := # Specify any additional compiler flags to be used. -COMPILER_FLAGS = +COMPILER_FLAGS = -Werror # Specify any additional linker flags to be used. LINKER_FLAGS = diff --git a/addons/AddOns/Twirl/Makefile b/addons/AddOns/Twirl/Makefile index 0cd9f113..bbc25729 100644 --- a/addons/AddOns/Twirl/Makefile +++ b/addons/AddOns/Twirl/Makefile @@ -93,7 +93,7 @@ LOCAL_INCLUDE_PATHS = ${Addon-Includes} # Specify the level of optimization that you want. Specify either NONE (O0), # SOME (O1), FULL (O2), or leave blank (for the default optimization level). -OPTIMIZE := +OPTIMIZE := FULL # Specify the codes for languages you are going to support in this # application. The default "en" one must be provided too. "make catkeys" @@ -111,7 +111,7 @@ DEFINES = # Specify the warning level. Either NONE (suppress all warnings), # ALL (enable all warnings), or leave blank (enable default warnings). -WARNINGS = +WARNINGS = ALL # With image symbols, stack crawls in the debugger are meaningful. # If set to "TRUE", symbols will be created. @@ -122,7 +122,7 @@ SYMBOLS := DEBUGGER := # Specify any additional compiler flags to be used. -COMPILER_FLAGS = +COMPILER_FLAGS = -Werror # Specify any additional linker flags to be used. LINKER_FLAGS = diff --git a/addons/AddOns/Twirl/Twirl.cpp b/addons/AddOns/Twirl/Twirl.cpp index 4a8a07fd..504aa5a5 100644 --- a/addons/AddOns/Twirl/Twirl.cpp +++ b/addons/AddOns/Twirl/Twirl.cpp @@ -156,7 +156,6 @@ TwirlManipulator::ManipulateBitmap( for (float x = 0; x < source_bpr; x++) { real_x = x - cx; real_y = y - cy; - uint32 target_value = 0x00000000; distance = sqrt(real_x * real_x + real_y * real_y); if (distance <= center_distance_from_edges) { @@ -218,7 +217,6 @@ TwirlManipulator::ManipulateBitmap( if (selection->ContainsPoint(x, y)) { real_x = x - cx; real_y = y - cy; - uint32 target_value = 0x00000000; distance = sqrt(real_x * real_x + real_y * real_y); if (distance <= center_distance_from_edges) { diff --git a/addons/AddOns/Wave/Makefile b/addons/AddOns/Wave/Makefile index e80deb53..77cbd3c7 100644 --- a/addons/AddOns/Wave/Makefile +++ b/addons/AddOns/Wave/Makefile @@ -93,7 +93,7 @@ LOCAL_INCLUDE_PATHS = ${Addon-Includes} # Specify the level of optimization that you want. Specify either NONE (O0), # SOME (O1), FULL (O2), or leave blank (for the default optimization level). -OPTIMIZE := +OPTIMIZE := FULL # Specify the codes for languages you are going to support in this # application. The default "en" one must be provided too. "make catkeys" @@ -111,7 +111,7 @@ DEFINES = # Specify the warning level. Either NONE (suppress all warnings), # ALL (enable all warnings), or leave blank (enable default warnings). -WARNINGS = +WARNINGS = ALL # With image symbols, stack crawls in the debugger are meaningful. # If set to "TRUE", symbols will be created. @@ -122,7 +122,7 @@ SYMBOLS := DEBUGGER := # Specify any additional compiler flags to be used. -COMPILER_FLAGS = +COMPILER_FLAGS = -Werror # Specify any additional linker flags to be used. LINKER_FLAGS = diff --git a/addons/AddOns/Wave/Wave.cpp b/addons/AddOns/Wave/Wave.cpp index 9e51684f..0c097929 100644 --- a/addons/AddOns/Wave/Wave.cpp +++ b/addons/AddOns/Wave/Wave.cpp @@ -128,7 +128,6 @@ WaveManipulator::ManipulateBitmap( float dx = 0; float dy = 0; float sqrt_x_plus_y; - float one_per_sqrt_x_plus_y; float cx, cy; int32 top, bottom; top = start_y; @@ -161,7 +160,6 @@ WaveManipulator::ManipulateBitmap( for (float x = 0; x < float_target_bpr; x++) { real_x = x - cx; real_y = y - cy; - uint32 target_value = 0x00000000; if ((real_x != 0) && (real_y != 0)) { sqrt_x_plus_y = sqrt(real_x * real_x + real_y * real_y); dx = real_x / sqrt_x_plus_y * A @@ -209,7 +207,6 @@ WaveManipulator::ManipulateBitmap( sqrt_x_plus_y = sqrt(real_x * real_x); dx = real_x / sqrt_x_plus_y * A * sin(sqrt_x_plus_y * two_pi_per_s); dx = dx * (1 - k * sqrt_x_plus_y / R); - int32 ceil_y = ceil(y + dy); int32 floor_x = floor(x + dx); int32 ceil_x = floor_x + 1; float x_mix_right = (x + dx) - floor_x; @@ -229,7 +226,6 @@ WaveManipulator::ManipulateBitmap( dy = dy * (1 - k * sqrt_x_plus_y / R); int32 ceil_y = ceil(y + dy); int32 floor_y = ceil_y - 1; - int32 floor_x = floor(x + dx); float y_mix_upper = ceil(y + dy) - (y + dy); if ((ceil_y <= bottom) && (ceil_y >= top)) p1 = *(source_bits + (int32)x + ceil_y * target_bpr); @@ -259,7 +255,6 @@ WaveManipulator::ManipulateBitmap( if (selection->ContainsPoint(x, y) == TRUE) { real_x = x - cx; real_y = y - cy; - uint32 target_value = 0x00000000; if ((real_x != 0) && (real_y != 0)) { sqrt_x_plus_y = sqrt(real_x * real_x + real_y * real_y); dx = real_x / sqrt_x_plus_y * A diff --git a/addons/AddOns/WoodRelief/Makefile b/addons/AddOns/WoodRelief/Makefile index 0b05e2d8..6faaea3d 100644 --- a/addons/AddOns/WoodRelief/Makefile +++ b/addons/AddOns/WoodRelief/Makefile @@ -93,7 +93,7 @@ LOCAL_INCLUDE_PATHS = ${Addon-Includes} # Specify the level of optimization that you want. Specify either NONE (O0), # SOME (O1), FULL (O2), or leave blank (for the default optimization level). -OPTIMIZE := +OPTIMIZE := FULL # Specify the codes for languages you are going to support in this # application. The default "en" one must be provided too. "make catkeys" @@ -111,7 +111,7 @@ DEFINES = # Specify the warning level. Either NONE (suppress all warnings), # ALL (enable all warnings), or leave blank (enable default warnings). -WARNINGS = +WARNINGS = ALL # With image symbols, stack crawls in the debugger are meaningful. # If set to "TRUE", symbols will be created. @@ -122,7 +122,7 @@ SYMBOLS := DEBUGGER := # Specify any additional compiler flags to be used. -COMPILER_FLAGS = +COMPILER_FLAGS = -Werror # Specify any additional linker flags to be used. LINKER_FLAGS = diff --git a/addons/AddOns/WoodRelief/Wood.cpp b/addons/AddOns/WoodRelief/Wood.cpp index 5c7cf4b7..f860da80 100644 --- a/addons/AddOns/WoodRelief/Wood.cpp +++ b/addons/AddOns/WoodRelief/Wood.cpp @@ -135,7 +135,7 @@ WoodManipulator::thread_function(int32 thread_number) union { uint8 bytes[4]; uint32 word; - } color, color1, color2, color3; + } color1, color2, color3; if (selection->IsEmpty()) { // Here handle the whole image. @@ -161,7 +161,6 @@ WoodManipulator::thread_function(int32 thread_number) source += (int32)top * source_bpr; for (float y = top; y <= bottom; ++y) { - int32 y_times_bpr = y * source_bpr; for (float x = left; x <= right; ++x) { color1.word = *(spare_bits - spare_bpr - 1); diff --git a/addons/UtilityClasses/BitmapAnalyzer.h b/addons/UtilityClasses/BitmapAnalyzer.h index 0f70ae1c..caa92274 100644 --- a/addons/UtilityClasses/BitmapAnalyzer.h +++ b/addons/UtilityClasses/BitmapAnalyzer.h @@ -68,9 +68,9 @@ float BitmapAnalyzer::GradientMagnitude(BPoint point) float BitmapAnalyzer::GradientMagnitude(int32 x,int32 y) { // The eight surrounding pixel-values (luminance) - float lt,t,rt; - float l,r; - float lb,b,rb; + float lt = 0, t = 0, rt = 0; + float l = 0, r = 0; + float lb = 0, b = 0, rb = 0; if (!buffered) { int32 left_x = x-1; diff --git a/addons/UtilityClasses/ImageProcessingLibrary.cpp b/addons/UtilityClasses/ImageProcessingLibrary.cpp index 0c5647b3..12283426 100644 --- a/addons/UtilityClasses/ImageProcessingLibrary.cpp +++ b/addons/UtilityClasses/ImageProcessingLibrary.cpp @@ -774,7 +774,7 @@ ImageProcessingLibrary::calculate_local_mapping_function_clip( top = clipLimit; bottom = 0; int32 middle; - int32 S; + int32 S = 0; while ((top - bottom) > 1) { middle = (top + bottom) / 2; S = 0; diff --git a/artpaint/Utilities/BitmapUtilities.cpp b/artpaint/Utilities/BitmapUtilities.cpp index 33901710..04bbc7a2 100644 --- a/artpaint/Utilities/BitmapUtilities.cpp +++ b/artpaint/Utilities/BitmapUtilities.cpp @@ -108,7 +108,6 @@ BitmapUtilities::ConvertColorSpace(BBitmap* inBitmap, color_space wantSpace) union color_conversion c; out_map->LockBits(); - uint32 pos = 0; for (int32 y = 0; y <= out_map->Bounds().IntegerHeight(); y++) { for (int32 x = 0; x <= out_map->Bounds().IntegerWidth(); x++) { c.word = *(in_bits + x + y * in_bpr); @@ -145,7 +144,6 @@ BitmapUtilities::ConvertToMask(BBitmap* inBitmap, uint8 color) union color_conversion c; out_map->LockBits(); - uint32 pos = 0; for (int32 y = 0; y < out_map->Bounds().IntegerHeight() + 1; y++) { for (int32 x = 0; x < out_map->Bounds().IntegerWidth() + 1; x++) { c.word = *(in_bits + x + y * in_bpr); @@ -201,9 +199,9 @@ BitmapUtilities::CompositeBitmapOnSource(BBitmap* toBuffer, BBitmap* srcBuffer, void BitmapUtilities::ClearBitmap(BBitmap* bitmap, uint32 color, BRect* area) { - uint32 width = bitmap->Bounds().IntegerWidth() + 1; - uint32 height = bitmap->Bounds().IntegerHeight() + 1; - uint32 bpr = bitmap->BytesPerRow() / 4; + int32 width = bitmap->Bounds().IntegerWidth() + 1; + int32 height = bitmap->Bounds().IntegerHeight() + 1; + int32 bpr = bitmap->BytesPerRow() / 4; int32 start_x = 0; int32 start_y = 0; @@ -237,9 +235,9 @@ void BitmapUtilities::CheckerBitmap( BBitmap* bitmap, uint32 color1, uint32 color2, uint32 grid_size, BRect* area) { - uint32 width = bitmap->Bounds().IntegerWidth() + 1; - uint32 height = bitmap->Bounds().IntegerHeight() + 1; - uint32 bpr = bitmap->BytesPerRow() / 4; + int32 width = bitmap->Bounds().IntegerWidth() + 1; + int32 height = bitmap->Bounds().IntegerHeight() + 1; + int32 bpr = bitmap->BytesPerRow() / 4; int32 start_x = 0; int32 start_y = 0; @@ -261,7 +259,7 @@ BitmapUtilities::CheckerBitmap( uint32* bits = (uint32*)bitmap->Bits(); bits += start_x + bpr * start_y; - uint32 row_size = bpr - width; + int32 row_size = bpr - width; for (int y = start_y; y < height + start_y; ++y) { int rowMod2 = (y / grid_size) % 2; @@ -283,7 +281,6 @@ uint32 BitmapUtilities::GetPixel(BBitmap* bitmap, int32 x, int32 y) { uint32 bpr; - uint32 value; if (bitmap->Bounds().Contains(BPoint(x, y)) == false) return 0; @@ -380,7 +377,6 @@ BitmapUtilities::RasterToPolygonsMoore(BBitmap* bitmap, BRect bounds, BList* pol point_list[point_count++] = BPoint(x - 0.5, y - 0.5); int checkLocation = 1; - int newCheckLocation = 0; BPoint startPos = BPoint(pos); int end_counter = 0; int point_counter = 0; diff --git a/artpaint/application/PaintApplication.cpp b/artpaint/application/PaintApplication.cpp index 369b01bc..d5c79259 100644 --- a/artpaint/application/PaintApplication.cpp +++ b/artpaint/application/PaintApplication.cpp @@ -463,7 +463,7 @@ PaintApplication::Color(bool foreground) const if (settings.FindData((foreground ? skPrimaryColor : skSecondaryColor), B_RGB_COLOR_TYPE, (const void**)&data, &dataSize) == B_OK) { if (dataSize == sizeof(rgb_color)) - memcpy(color, data, sizeof(rgb_color)); + *color = *data; } } diff --git a/artpaint/application/Selection.cpp b/artpaint/application/Selection.cpp index d2b6b8f7..f57e5780 100644 --- a/artpaint/application/Selection.cpp +++ b/artpaint/application/Selection.cpp @@ -329,7 +329,7 @@ Selection::ReplaceSelection(BBitmap* bitmap) for (int32 y = 0; y <= height; ++y) { for (int32 x = 0; x < width; ++x) { uint8* ptr = selection_bits + x + y * selection_bpr; - if (x > new_bpr || y > bitmap->Bounds().IntegerHeight()) + if (x > (int32)new_bpr || y > bitmap->Bounds().IntegerHeight()) *ptr = 0; else *ptr = *(new_bits + x + y * new_bpr); @@ -925,7 +925,7 @@ Selection::SimplifySelection() BList polygons; BitmapUtilities::RasterToPolygonsMoore(selection_map, bounds, &polygons); - for (uint32 i = 0; i < polygons.CountItems(); ++i) { + for (int32 i = 0; i < polygons.CountItems(); ++i) { HSPolygon* new_polygon = (HSPolygon*)polygons.ItemAt(i); selection_data->AddSelection(new_polygon); } diff --git a/artpaint/application/SettingsServer.cpp b/artpaint/application/SettingsServer.cpp index 90db9882..8787876f 100644 --- a/artpaint/application/SettingsServer.cpp +++ b/artpaint/application/SettingsServer.cpp @@ -209,7 +209,7 @@ SettingsServer::GetApplicationSettings(BMessage* message) while (fApplicationSettings.FindData(skRecentImageSize, B_RAW_TYPE, i++, (const void**)&data, &dataSize) == B_OK) { if (dataSize == sizeof(BSize)) { - memcpy(&size, data, sizeof(BSize)); + size = *data; fRecentImageSizeList.push_back(size); } } diff --git a/artpaint/application/UndoAction.cpp b/artpaint/application/UndoAction.cpp index 0c1c96ca..24d743ad 100644 --- a/artpaint/application/UndoAction.cpp +++ b/artpaint/application/UndoAction.cpp @@ -198,7 +198,7 @@ UndoAction::StoreUndo(BBitmap* bitmap) success = TRUE; tries++; } - catch (std::bad_alloc e) { + catch (const std::bad_alloc& e) { queue->HandleLowMemorySituation(); } } @@ -315,7 +315,7 @@ UndoAction::ApplyUndo(BBitmap* bitmap, BRect& updated_rect) } return NULL; } - catch (std::bad_alloc e) { + catch (const std::bad_alloc& e) { queue->HandleLowMemorySituation(); throw e; } @@ -425,7 +425,7 @@ UndoAction::StoreDifferences(BBitmap* old, BBitmap* current, BRect area) StoreDifferences(old, current, rect4); } } - catch (std::bad_alloc e) { + catch (const std::bad_alloc& e) { throw e; } } diff --git a/artpaint/controls/ColorPalette.cpp b/artpaint/controls/ColorPalette.cpp index 5f75e50f..f2e6ed86 100644 --- a/artpaint/controls/ColorPalette.cpp +++ b/artpaint/controls/ColorPalette.cpp @@ -73,14 +73,14 @@ HexStringToUInt32(BString hexColor, uint32& color_word) char digit = hexColor.ByteAt(i); uint32 byte = 0; byteStr.SetToFormat("%c%c", digit, digit); - byteStr.ScanWithFormat("%X", &byte); + byteStr.ScanWithFormat("%" B_PRIX32, &byte); color.bytes[2 - i] = (uint8)byte; } if (hexColor.Length() == 4) { char digit = hexColor.ByteAt(3); uint32 byte = 0; byteStr.SetToFormat("%c%c", digit, digit); - byteStr.ScanWithFormat("%X", &byte); + byteStr.ScanWithFormat("%" B_PRIX32, &byte); color.bytes[3] = (uint8)byte; } else color.bytes[3] = (uint8)0xFF; @@ -96,7 +96,7 @@ HexStringToUInt32(BString hexColor, uint32& color_word) char digit2 = hexColor.ByteAt(j + 1); uint32 byte = 0; byteStr.SetToFormat("%c%c", digit1, digit2); - byteStr.ScanWithFormat("%X", &byte); + byteStr.ScanWithFormat("%" B_PRIX32, &byte); color.bytes[2 - i] = (uint8)byte; } if (hexColor.Length() == 8) { @@ -104,7 +104,7 @@ HexStringToUInt32(BString hexColor, uint32& color_word) char digit2 = hexColor.ByteAt(7); uint32 byte = 0; byteStr.SetToFormat("%c%c", digit1, digit2); - byteStr.ScanWithFormat("%X", &byte); + byteStr.ScanWithFormat("%" B_PRIX32, &byte); color.bytes[3] = (uint8)byte; } else color.bytes[3] = 0xFF; @@ -179,7 +179,7 @@ ColorPaletteWindow::ColorPaletteWindow(BRect frame, int32 mode) colorSetName = new BTextControl("", "color-set-name", new BMessage(HS_SET_NAME_CHANGED)); - BGridLayout* colorSetGrid = BLayoutBuilder::Grid<>(container_box, 2, B_USE_SMALL_SPACING) + BLayoutBuilder::Grid<>(container_box, 2, B_USE_SMALL_SPACING) .Add(previous_set, 0, 0) .Add(colorSetName, 1, 0) .Add(next_set, 2, 0) @@ -260,8 +260,7 @@ ColorPaletteWindow::ColorPaletteWindow(BRect frame, int32 mode) .End() .SetInsets(5, 5, 5, 5); - BGroupLayout* mainLayout - = BLayoutBuilder::Group<>(this, B_VERTICAL, 0).Add(menu_bar).Add(colorLayout).Add(container_box); + BLayoutBuilder::Group<>(this, B_VERTICAL, 0).Add(menu_bar).Add(colorLayout).Add(container_box); // call some function that initializes the views depending on the mode openControlViews(mode); @@ -1833,7 +1832,7 @@ ColorSet::ColorSet(int32 amount_of_colors, ColorSet* copy_this_palette) if (copy_this_palette == NULL) // create a default name - sprintf(name, "%s %d", B_TRANSLATE("Color set"), index); + sprintf(name, "%s %" B_PRId32, B_TRANSLATE("Color set"), index); else sprintf(name, "%s %s", copy_this_palette->getName(), "copy"); diff --git a/artpaint/controls/NumberSliderControl.cpp b/artpaint/controls/NumberSliderControl.cpp index d75716ea..b7544e26 100644 --- a/artpaint/controls/NumberSliderControl.cpp +++ b/artpaint/controls/NumberSliderControl.cpp @@ -42,10 +42,10 @@ NumberSliderControl::NumberSliderControl(const char* label, const char* text, BM fMaxRange(maxRange), fContinuous(continuous), fSlider(NULL), - fMessage(message), - fNumberControl(NULL), fProportional(proportional), - fExp(4) + fExp(4), + fMessage(message), + fNumberControl(NULL) { _InitMessage(); diff --git a/artpaint/controls/NumberSliderControl.h b/artpaint/controls/NumberSliderControl.h index 823b30f4..698892a9 100644 --- a/artpaint/controls/NumberSliderControl.h +++ b/artpaint/controls/NumberSliderControl.h @@ -65,10 +65,10 @@ class NumberSliderControl : public BBox { int32 fMinRange; int32 fMaxRange; bool fContinuous; + BSlider* fSlider; bool fProportional; int8 fExp; - BSlider* fSlider; BMessage* fMessage; NumberControl* fNumberControl; }; diff --git a/artpaint/layers/Layer.cpp b/artpaint/layers/Layer.cpp index 03115b54..6bb1363a 100644 --- a/artpaint/layers/Layer.cpp +++ b/artpaint/layers/Layer.cpp @@ -459,7 +459,7 @@ Layer::readLayer(BFile& file, ImageView* imageView, int32 new_id, bool is_little layer->SetTransparency(coeff); length -= sizeof(float); - if (length > sizeof(int32)) { + if (length > (int32)sizeof(int32)) { int32 nameLen; if (file.Read(&nameLen, sizeof(int32)) == sizeof(int32)) { char name[nameLen + 1]; diff --git a/artpaint/layers/LayerView.cpp b/artpaint/layers/LayerView.cpp index b8dc906a..ee51b01d 100644 --- a/artpaint/layers/LayerView.cpp +++ b/artpaint/layers/LayerView.cpp @@ -50,7 +50,7 @@ LayerView::LayerView(BBitmap* image, Layer* layer) a_message.what = HS_LAYER_NAME_CHANGED; layer_name_field = new BTextControl("", "Layer", new BMessage(a_message)); - BGroupLayout* layerLayout = BLayoutBuilder::Group<>(this, B_HORIZONTAL, B_USE_SMALL_SPACING) + BLayoutBuilder::Group<>(this, B_HORIZONTAL, B_USE_SMALL_SPACING) .Add(visibility_box) .Add(thumbnail_view) .Add(layer_name_field) @@ -121,7 +121,6 @@ LayerView::MouseDown(BPoint location) uint32 buttons; Window()->CurrentMessage()->FindInt32("buttons", (int32*) &buttons); - BRect mini_image_frame = thumbnail_view->Frame(); if (image_window != NULL) { a_message.what = HS_LAYER_ACTIVATED; diff --git a/artpaint/layers/LayerWindow.cpp b/artpaint/layers/LayerWindow.cpp index 6576bb71..568a7d7b 100644 --- a/artpaint/layers/LayerWindow.cpp +++ b/artpaint/layers/LayerWindow.cpp @@ -225,7 +225,7 @@ LayerWindow::LayerWindow(BRect frame) transparency_slider->Slider()->SetToolTip(B_TRANSLATE("Layer transparency")); - BGroupLayout* topLayout = BLayoutBuilder::Group<>(top_part, B_VERTICAL) + BLayoutBuilder::Group<>(top_part, B_VERTICAL) .Add(transparencyLayout) .SetInsets(B_USE_SMALL_INSETS, B_USE_SMALL_INSETS, B_USE_SMALL_INSETS, B_USE_SMALL_INSETS); @@ -236,7 +236,7 @@ LayerWindow::LayerWindow(BRect frame) = new BScrollView("scroller", list_view, B_FRAME_EVENTS, false, true, B_NO_BORDER); scroll_view->ScrollBar(B_VERTICAL)->SetSteps(8.0, 32.0); - BGroupLayout* mainLayout = BLayoutBuilder::Group<>(this, B_VERTICAL, 0) + BLayoutBuilder::Group<>(this, B_VERTICAL, 0) .Add(menu) .Add(top_part) .Add(scroll_view) diff --git a/artpaint/paintwindow/Image.cpp b/artpaint/paintwindow/Image.cpp index b68fbe45..639e50c3 100644 --- a/artpaint/paintwindow/Image.cpp +++ b/artpaint/paintwindow/Image.cpp @@ -353,7 +353,7 @@ Image::AddLayer(BBitmap* bitmap, Layer* next_layer, bool add_to_front, new_layer = new Layer(BRect(0, 0, image_width - 1, image_height - 1), layer_id, image_view, HS_NORMAL_LAYER, bitmap, offset); } - catch (std::bad_alloc e) { + catch (const std::bad_alloc& e) { delete bitmap; throw e; } @@ -1070,9 +1070,9 @@ Image::calculate_thumbnail_image(void* data) color.bytes[2] = 0xFF; color.bytes[3] = 0x00; - uint32 miniature_width = (uint32)( + int32 miniature_width = (int32)( (to->Bounds().Width() + 1) * (min_c(from->Bounds().Width() / from->Bounds().Height(), 1))); - uint32 miniature_height = (uint32)( + int32 miniature_height = (int32)( (to->Bounds().Height() + 1) * (min_c(from->Bounds().Height() / from->Bounds().Width(), 1))); // Here we copy the contents of the_bitmap to miniature image. @@ -1341,9 +1341,6 @@ Image::DoRender(BRect area, bool bg) s_bits += srl * s_start_y + s_start_x; d_bits += drl * d_start_y + d_start_x; - uint32 As; - uint32 Ad; - // Alpha-value is presence of pixel, hence 0x00 is transparent and 0xff for alpha // is fully visible. for (int32 y = 0; y < height; ++y) { diff --git a/artpaint/paintwindow/ImageView.cpp b/artpaint/paintwindow/ImageView.cpp index 9330bec3..d2ffdd02 100644 --- a/artpaint/paintwindow/ImageView.cpp +++ b/artpaint/paintwindow/ImageView.cpp @@ -734,7 +734,7 @@ ImageView::MessageReceived(BMessage* message) Invalidate(); AddChange(); } - catch (std::bad_alloc) { + catch (const std::bad_alloc&) { ShowAlert(CANNOT_ADD_LAYER_ALERT); } } break; @@ -758,7 +758,7 @@ ImageView::MessageReceived(BMessage* message) AddChange(); } } - catch (std::bad_alloc e) { + catch (const std::bad_alloc&) { ShowAlert(CANNOT_ADD_LAYER_ALERT); } } break; @@ -778,7 +778,7 @@ ImageView::MessageReceived(BMessage* message) AddChange(); } } - catch (std::bad_alloc) { + catch (const std::bad_alloc&) { ShowAlert(CANNOT_ADD_LAYER_ALERT); } } @@ -1042,7 +1042,7 @@ ImageView::MessageReceived(BMessage* message) } } } - catch (std::bad_alloc) { + catch (const std::bad_alloc&) { ShowAlert(CANNOT_START_MANIPULATOR_ALERT); delete fManipulator; fManipulator = NULL; @@ -1232,8 +1232,6 @@ ImageView::MouseMoved(BPoint where, uint32 transit, const BMessage* message) float width = tool->GetCurrentValue(SIZE_OPTION); float height = width; - drawing_mode old_mode = DrawingMode(); - Brush* brush; if (tool->GetCurrentValue(USE_BRUSH_OPTION)) { brush = ToolManager::Instance().GetCurrentBrush(); @@ -1494,8 +1492,6 @@ ImageView::setMagScale(float scale) int32 ImageView::findClosestMagIndex(float scale) { - int32 index = 0; - for (int i = 1; i <= mag_scale_array_length; ++i) { if (mag_scale_array[i] > scale) { float prev_scale = mag_scale_array[i - 1]; @@ -2070,7 +2066,7 @@ ImageView::ManipulatorFinisherThread() if (new_buffer != NULL) selection->ReplaceSelection(new_buffer); } else { - BBitmap* new_buffer = fManipulator->ManipulateSelectionMap(); + BBitmap* new_buffer = fManipulator->ManipulateSelectionBitmap(); if (new_buffer != NULL) selection->ReplaceSelection(new_buffer); } @@ -2176,7 +2172,7 @@ ImageView::ManipulatorFinisherThread() } } } - } catch (std::bad_alloc e) { + } catch (const std::bad_alloc& e) { ShowAlert(CANNOT_FINISH_MANIPULATOR_ALERT); // The manipulator should be asked to reset the preview-bitmap, if it is // a GUIManipulator. @@ -2410,7 +2406,6 @@ ImageView::DoCopyOrCut(int32 layers, bool cut) { if (acquire_sem_etc(action_semaphore, 1, B_TIMEOUT, 0) == B_OK) { BBitmap* buffer; - BRect* offset; bool ok_to_archive = TRUE; if (layers == HS_MANIPULATE_CURRENT_LAYER) buffer = the_image->ReturnActiveBitmap(); @@ -2514,7 +2509,7 @@ ImageView::DoPaste() AddChange(); } } - catch (std::bad_alloc e) { + catch (const std::bad_alloc& e) { ShowAlert(CANNOT_ADD_LAYER_ALERT); } } diff --git a/artpaint/paintwindow/PaintWindow.cpp b/artpaint/paintwindow/PaintWindow.cpp index 5993521d..1bb1b8fc 100644 --- a/artpaint/paintwindow/PaintWindow.cpp +++ b/artpaint/paintwindow/PaintWindow.cpp @@ -109,14 +109,16 @@ PaintWindow::PaintWindow(BRect frame, const char* name, uint32 views, const BMes fHorizontalScrollbar(NULL), fMenubar(NULL), fStatusView(NULL), + fRecentImages(NULL), + fRecentProjects(NULL), fContainerBox(NULL), fSetSizeButton(NULL), fWidthNumberControl(NULL), fHeightNumberControl(NULL), fImageSavePanel(NULL), fProjectSavePanel(NULL), - fCurrentHandler(0), - fImageSizeWindow(NULL) + fImageSizeWindow(NULL), + fCurrentHandler(0) { sgPaintWindowCount++; SetSizeLimits(500, 10000, 400, 10000); @@ -625,7 +627,7 @@ PaintWindow::MessageReceived(BMessage* message) fImageView->ReturnImage()->InsertLayer(); success = true; } - catch (std::bad_alloc) { + catch (const std::bad_alloc& e) { delete fImageView; fImageView = NULL; BAlert* alert = new BAlert("", B_TRANSLATE( diff --git a/artpaint/paintwindow/StatusView.cpp b/artpaint/paintwindow/StatusView.cpp index f3ae0fa7..fa843723 100644 --- a/artpaint/paintwindow/StatusView.cpp +++ b/artpaint/paintwindow/StatusView.cpp @@ -53,7 +53,7 @@ StatusView::StatusView() coordinate_view = new BStringView("coordinate_view", "X: , Y:"); coordinate_box = new BBox("coordinate box"); - BGroupLayout* boxLayout = BLayoutBuilder::Group<>(coordinate_box, B_HORIZONTAL) + BLayoutBuilder::Group<>(coordinate_box, B_HORIZONTAL) .Add(coordinate_view) .SetInsets(3.0, 5.0, 3.0, 5.0); diff --git a/artpaint/tools/AirBrushTool.cpp b/artpaint/tools/AirBrushTool.cpp index 9ef0cd7a..adfee19e 100644 --- a/artpaint/tools/AirBrushTool.cpp +++ b/artpaint/tools/AirBrushTool.cpp @@ -116,8 +116,6 @@ AirBrushTool::UseTool(ImageView* view, uint32 buttons, BPoint point, BPoint) ImageUpdater* imageUpdater = new ImageUpdater(view, 20000); - status_t status_of_read; - if (fToolSettings.mode == HS_AIRBRUSH_MODE) { // Do the airbrush BRect bounds = bitmap->Bounds(); BRect rc; diff --git a/artpaint/tools/BitmapDrawer.cpp b/artpaint/tools/BitmapDrawer.cpp index bef66247..9df2977f 100644 --- a/artpaint/tools/BitmapDrawer.cpp +++ b/artpaint/tools/BitmapDrawer.cpp @@ -55,8 +55,6 @@ BitmapDrawer::DrawHairLine(BPoint start, BPoint end, uint32 color, bool anti_ali else sign_x = 0; } - uint32 old_value; - uint32 new_value; if (anti_alias == TRUE) { // Here we should take the line's equation and draw with Wu's algorithm. @@ -409,7 +407,7 @@ BitmapDrawer::_FillShearedColumn(int32 x, int32 y, int32 dx, int32 dy0, y0 = temp; } - for (uint32 yy = y0; yy <= y1; ++yy) + for (int32 yy = y0; yy <= y1; ++yy) SetPixel(x0, yy, color, sel, composite_func); } diff --git a/artpaint/tools/BlurTool.cpp b/artpaint/tools/BlurTool.cpp index 1b071dfb..6e70c75f 100644 --- a/artpaint/tools/BlurTool.cpp +++ b/artpaint/tools/BlurTool.cpp @@ -93,8 +93,8 @@ BlurTool::UseTool(ImageView* view, uint32 buttons, BPoint point, BPoint) Brush* brush; BBitmap* brush_bmap; - uint32* brush_bits; - uint32 brush_bpr; + uint32* brush_bits = NULL; + uint32 brush_bpr = 0; if (fToolSettings.use_current_brush == true) { brush = ToolManager::Instance().GetCurrentBrush(); diff --git a/artpaint/tools/Brush.cpp b/artpaint/tools/Brush.cpp index 7b4bb7f6..0deafff6 100644 --- a/artpaint/tools/Brush.cpp +++ b/artpaint/tools/Brush.cpp @@ -75,7 +75,7 @@ Brush::Brush(brush_info& info) num_shapes = polygons.CountItems(); shapes = new HSPolygon*[num_shapes]; - for (uint32 i = 0; i < polygons.CountItems(); ++i) { + for (int32 i = 0; i < polygons.CountItems(); ++i) { HSPolygon* new_polygon = (HSPolygon*)polygons.ItemAt(i); shapes[i] = new_polygon; } @@ -130,7 +130,7 @@ Brush::ModifyBrush(brush_info& info) num_shapes = polygons.CountItems(); shapes = new HSPolygon*[num_shapes]; - for (uint32 i = 0; i < polygons.CountItems(); ++i) { + for (int32 i = 0; i < polygons.CountItems(); ++i) { HSPolygon* new_polygon = (HSPolygon*)polygons.ItemAt(i); shapes[i] = new_polygon; } @@ -439,7 +439,7 @@ Brush::PreviewBrush(BBitmap* preview_bitmap) font.SetSize(bmap_width / 6); BString brushSizeString; float brushSize = max_c(actual_width, actual_height); - brushSizeString.SetToFormat("%d", (int32)brushSize); + brushSizeString.SetToFormat("%" B_PRId32, (int32)brushSize); int32 strWidth = font.StringWidth("000"); font_height strHeight; diff --git a/artpaint/tools/ColorSelectorTool.cpp b/artpaint/tools/ColorSelectorTool.cpp index bfdce24d..e06a9f06 100644 --- a/artpaint/tools/ColorSelectorTool.cpp +++ b/artpaint/tools/ColorSelectorTool.cpp @@ -323,7 +323,6 @@ ColorSelectorTool::UseTool(ImageView* view, uint32 buttons, BPoint point, BPoint BRect view_rc = view->convertBitmapRectToView(rc); view_rc.right -= scale; view_rc.bottom -= scale; - BRect old_rc = view_rc; BRect bounds = bitmap->Bounds(); rc = rc & bounds; @@ -333,8 +332,6 @@ ColorSelectorTool::UseTool(ImageView* view, uint32 buttons, BPoint point, BPoint rc.OffsetBySelf(-half_size, -half_size); rc = rc & bounds; - int32 x_dist, y_sqr; - int32 width = rc.IntegerWidth(); int32 height = rc.IntegerHeight(); float red = 0; @@ -381,7 +378,6 @@ ColorSelectorTool::UseTool(ImageView* view, uint32 buttons, BPoint point, BPoint if (color != old_color) { cs_window->ChangeValue(color); old_color = color; - rgb_color c = BGRAColorToRGB(color); } if (cs_window->Frame().Contains(view->ConvertToScreen(view_point))) cs_window->Move(view->ConvertToScreen(view_point)); diff --git a/artpaint/tools/EraserTool.cpp b/artpaint/tools/EraserTool.cpp index 44e35a04..67475497 100644 --- a/artpaint/tools/EraserTool.cpp +++ b/artpaint/tools/EraserTool.cpp @@ -140,7 +140,6 @@ EraserTool::UseTool(ImageView* view, uint32 buttons, BPoint point, BPoint) prev_point = point; BRect updated_rect; - status_t status_of_read; Brush* brush; float brush_width_per_2; diff --git a/artpaint/tools/FillTool.cpp b/artpaint/tools/FillTool.cpp index 85d86e59..13dd0ef5 100644 --- a/artpaint/tools/FillTool.cpp +++ b/artpaint/tools/FillTool.cpp @@ -814,7 +814,7 @@ FillTool::FillGradientLinear(BitmapDrawer* drawer, BBitmap* binary_map, BPoint s float cos_angle = cos(perp_angle); float sin_angle = sin(perp_angle); - union color_conversion source, dest, begin, temp; + union color_conversion source, dest; source.word = new_color; dest.word = gradient_color; @@ -882,7 +882,7 @@ FillTool::FillGradientRadial(BitmapDrawer* drawer, BBitmap* binary_map, BPoint s float total_dist = sqrt(pow(dx, 2) + pow(dy, 2)); - union color_conversion source, dest, begin, temp; + union color_conversion source, dest; source.word = new_color; dest.word = gradient_color; @@ -950,7 +950,7 @@ FillTool::FillGradientSquare(BitmapDrawer* drawer, BBitmap* binary_map, BPoint s perp_angle = atan(-dx / dy); float cos_angle = cos(perp_angle); float sin_angle = sin(perp_angle); - union color_conversion source, dest, begin, temp; + union color_conversion source, dest; source.word = new_color; dest.word = gradient_color; @@ -1022,7 +1022,7 @@ FillTool::FillGradientConic(BitmapDrawer* drawer, BBitmap* binary_map, BPoint st float cos_angle = cos(perp_angle); float sin_angle = sin(perp_angle); - union color_conversion source, dest, begin, temp; + union color_conversion source, dest; source.word = new_color; dest.word = gradient_color; diff --git a/artpaint/tools/FreeLineTool.cpp b/artpaint/tools/FreeLineTool.cpp index 29d8908d..fc734632 100644 --- a/artpaint/tools/FreeLineTool.cpp +++ b/artpaint/tools/FreeLineTool.cpp @@ -98,10 +98,9 @@ FreeLineTool::UseTool(ImageView* view, uint32 buttons, BPoint point, BPoint) delete srcBuffer; return NULL; } - union color_conversion clear_color, tmp_draw_color; + union color_conversion clear_color; clear_color.word = 0xFFFFFFFF; clear_color.bytes[3] = 0x00; - tmp_draw_color.word = 0xFFFFFFFF; BitmapUtilities::ClearBitmap(tmpBuffer, clear_color.word); diff --git a/artpaint/tools/HairyBrushTool.cpp b/artpaint/tools/HairyBrushTool.cpp index 6763f6a8..cfa66ef3 100644 --- a/artpaint/tools/HairyBrushTool.cpp +++ b/artpaint/tools/HairyBrushTool.cpp @@ -94,11 +94,7 @@ HairyBrushTool::UseTool(ImageView* view, uint32 buttons, BPoint point, BPoint) float color_randomnessx2 = color_randomness * 2.0; float initial_color_amount = GetCurrentValue(CONTINUITY_OPTION) / 10.0; float color_amount_randomness = 4; - bool use_fg_color = true; - if (buttons == B_SECONDARY_MOUSE_BUTTON) - use_fg_color = false; - rgb_color color = ((PaintApplication*)be_app)->Color(use_fg_color); int32 hair_count = GetCurrentValue(SIZE_OPTION); float* color_amount_array = new float[hair_count]; diff --git a/artpaint/tools/RectangleTool.cpp b/artpaint/tools/RectangleTool.cpp index d69faee6..d6b64c74 100644 --- a/artpaint/tools/RectangleTool.cpp +++ b/artpaint/tools/RectangleTool.cpp @@ -204,9 +204,6 @@ RectangleTool::UseTool(ImageView* view, uint32 buttons, BPoint point, BPoint vie drawer->DrawRectanglePolygon(outerPoly->GetPointList(), tmp_draw_color.word, fill, anti_a, selection); if (width > 1) { - union color_conversion rev_color; - rev_color.word = tmp_draw_color.word; - rev_color.bytes[3] = 0xFF; drawer->DrawRectanglePolygon( innerPoly->GetPointList(), tmp_draw_color.word, fill, anti_a, selection, dst_out_fixed); @@ -302,9 +299,6 @@ RectangleTool::UseTool(ImageView* view, uint32 buttons, BPoint point, BPoint vie drawer->DrawRectanglePolygon(outerPoly->GetPointList(), tmp_draw_color.word, fill, anti_a, selection); if (width > 1) { - union color_conversion rev_color; - rev_color.word = tmp_draw_color.word; - rev_color.bytes[3] = 0xFF; drawer->DrawRectanglePolygon( innerPoly->GetPointList(), tmp_draw_color.word, fill, anti_a, selection, dst_out_fixed); @@ -374,9 +368,6 @@ RectangleTool::UseTool(ImageView* view, uint32 buttons, BPoint point, BPoint vie drawer->DrawRectanglePolygon( outerPoly->GetPointList(), tmp_draw_color.word, fill, anti_a, selection); - union color_conversion rev_color; - rev_color.word = tmp_draw_color.word; - rev_color.bytes[3] = 0xFF; drawer->DrawRectanglePolygon( innerPoly->GetPointList(), tmp_draw_color.word, fill, anti_a, selection, dst_out_fixed); @@ -550,11 +541,12 @@ RectangleToolConfigView::MessageReceived(BMessage* message) switch (message->what) { case OPTION_CHANGED: { - if (message->FindInt32("option") == FILL_ENABLED_OPTION) + if (message->FindInt32("option") == FILL_ENABLED_OPTION) { if (fFillRectangle->Value() == B_CONTROL_ON) fLineWidth->SetEnabled(FALSE); else fLineWidth->SetEnabled(TRUE); + } } break; } } diff --git a/artpaint/tools/SelectorTool.cpp b/artpaint/tools/SelectorTool.cpp index 30a56e67..4402a330 100644 --- a/artpaint/tools/SelectorTool.cpp +++ b/artpaint/tools/SelectorTool.cpp @@ -78,7 +78,6 @@ SelectorTool::UseTool(ImageView* view, uint32 buttons, BPoint point, BPoint view { // these are used when drawing the preview to the view BPoint original_point = point; - BPoint view_original_point = view_point; Selection* selection = view->GetSelection(); @@ -291,7 +290,6 @@ SelectorTool::UseTool(ImageView* view, uint32 buttons, BPoint point, BPoint view } else if (fToolSettings.shape == HS_CIRCLE || fToolSettings.shape == HS_RECTANGLE) { BRect old_rect, new_rect; old_rect = new_rect = BRect(point, point); - float left, top, right, bottom; the_script->AddPoint(point); selectionPoints = new BPoint[2]; diff --git a/artpaint/tools/StraightLineTool.cpp b/artpaint/tools/StraightLineTool.cpp index cfb55136..5cbb2258 100644 --- a/artpaint/tools/StraightLineTool.cpp +++ b/artpaint/tools/StraightLineTool.cpp @@ -75,7 +75,6 @@ StraightLineTool::UseTool(ImageView* view, uint32 buttons, BPoint point, BPoint snooze(50000); BWindow* window = view->Window(); - drawing_mode old_mode; BBitmap* buffer = view->ReturnImage()->ReturnActiveBitmap(); if (buffer == NULL) @@ -265,7 +264,6 @@ StraightLineTool::UseTool(ImageView* view, uint32 buttons, BPoint point, BPoint angle = atan2((point.y - original_point.y), (point.x - original_point.x)) * 180 / M_PI; int32 size = GetCurrentValue(SIZE_OPTION); - bool draw_line = true; BRect old_bbox; if (fToolSettings.mode == B_CONTROL_ON @@ -301,7 +299,6 @@ StraightLineTool::UseTool(ImageView* view, uint32 buttons, BPoint point, BPoint } else if (is_keys_data_valid) { if (last_key_event_bytes[0] == B_ESCAPE) { continue_adjusting_width = false; - draw_line = false; } is_keys_data_valid = false; } else { diff --git a/artpaint/tools/TransparencyTool.cpp b/artpaint/tools/TransparencyTool.cpp index fe7107f5..aa2f0b51 100644 --- a/artpaint/tools/TransparencyTool.cpp +++ b/artpaint/tools/TransparencyTool.cpp @@ -91,8 +91,8 @@ TransparencyTool::UseTool(ImageView* view, uint32 buttons, BPoint point, BPoint) float half_height = fToolSettings.size / 2; Brush* brush; BBitmap* brush_bmap; - uint32* brush_bits; - uint32 brush_bpr; + uint32* brush_bits = NULL; + uint32 brush_bpr = 0; if (fToolSettings.use_current_brush == true) { brush = ToolManager::Instance().GetCurrentBrush(); @@ -122,8 +122,6 @@ TransparencyTool::UseTool(ImageView* view, uint32 buttons, BPoint point, BPoint) uint8 transparency_value = ((100. - (float)fToolSettings.transparency) / 100.) * 255; - status_t status_of_read; - while (coordinate_reader->GetPoint(point) == B_OK) { if (selection == NULL || selection->IsEmpty() == true || selection->ContainsPoint(point)) { diff --git a/artpaint/viewmanipulators/CropManipulator.cpp b/artpaint/viewmanipulators/CropManipulator.cpp index 3b8c5f1b..21df16e8 100644 --- a/artpaint/viewmanipulators/CropManipulator.cpp +++ b/artpaint/viewmanipulators/CropManipulator.cpp @@ -331,13 +331,12 @@ CropManipulator::SetPreviewBitmap(BBitmap* bm) if (bm != NULL) { preview_bitmap = bm; copy_of_the_preview_bitmap = DuplicateBitmap(preview_bitmap); - BRect bounds = preview_bitmap->Bounds(); } else { preview_bitmap = NULL; copy_of_the_preview_bitmap = NULL; } } - catch (std::bad_alloc e) { + catch (const std::bad_alloc& e) { preview_bitmap = NULL; copy_of_the_preview_bitmap = NULL; throw e; diff --git a/artpaint/viewmanipulators/FlipManipulator.cpp b/artpaint/viewmanipulators/FlipManipulator.cpp index d8c5c66d..1f85c6c4 100644 --- a/artpaint/viewmanipulators/FlipManipulator.cpp +++ b/artpaint/viewmanipulators/FlipManipulator.cpp @@ -92,7 +92,7 @@ HorizFlipManipulator::ManipulateBitmap(BBitmap* original, BStatusBar* status_bar } if (has_selection == true) { - BBitmap* sel_map = ManipulateSelectionMap(); + BBitmap* sel_map = ManipulateSelectionBitmap(); selection->ReplaceSelection(sel_map); } @@ -101,12 +101,12 @@ HorizFlipManipulator::ManipulateBitmap(BBitmap* original, BStatusBar* status_bar BBitmap* -HorizFlipManipulator::ManipulateSelectionMap() +HorizFlipManipulator::ManipulateSelectionBitmap() { BRect bounds = selection->GetBoundingRect(); BBitmap* selection_map = new BBitmap(selection->ReturnSelectionMap()); - int32 height = bounds.IntegerHeight(); + //int32 height = bounds.IntegerHeight(); int32 width = bounds.IntegerWidth(); int32 width_per_2 = width / 2; uint8 left_bits, right_bits; @@ -219,7 +219,7 @@ VertFlipManipulator::ManipulateBitmap(BBitmap* original, BStatusBar* status_bar) } if (has_selection == true) { - BBitmap* sel_map = ManipulateSelectionMap(); + BBitmap* sel_map = ManipulateSelectionBitmap(); selection->ReplaceSelection(sel_map); } @@ -228,7 +228,7 @@ VertFlipManipulator::ManipulateBitmap(BBitmap* original, BStatusBar* status_bar) BBitmap* -VertFlipManipulator::ManipulateSelectionMap() +VertFlipManipulator::ManipulateSelectionBitmap() { BRect bounds = selection->GetBoundingRect(); diff --git a/artpaint/viewmanipulators/FlipManipulator.h b/artpaint/viewmanipulators/FlipManipulator.h index 9002d6fe..f1b724d3 100644 --- a/artpaint/viewmanipulators/FlipManipulator.h +++ b/artpaint/viewmanipulators/FlipManipulator.h @@ -22,7 +22,7 @@ class HorizFlipManipulator : public Manipulator { void SetTransformSelectionOnly(bool select_only) { transform_selection_only = select_only; } - BBitmap* ManipulateSelectionMap(); + BBitmap* ManipulateSelectionBitmap(); private: Selection* selection; @@ -40,7 +40,7 @@ class VertFlipManipulator : public Manipulator { void SetTransformSelectionOnly(bool select_only) { transform_selection_only = select_only; } - BBitmap* ManipulateSelectionMap(); + BBitmap* ManipulateSelectionBitmap(); private: Selection* selection; diff --git a/artpaint/viewmanipulators/FreeTransformManipulator.cpp b/artpaint/viewmanipulators/FreeTransformManipulator.cpp index 163c7654..8e5d528a 100644 --- a/artpaint/viewmanipulators/FreeTransformManipulator.cpp +++ b/artpaint/viewmanipulators/FreeTransformManipulator.cpp @@ -85,16 +85,6 @@ FreeTransformManipulator::PreviewBitmap(bool, BRegion* region) if (current_settings == previous_settings) return 0; - union { - uint8 bytes[4]; - uint32 word; - } white; - - white.bytes[0] = 0xFF; - white.bytes[1] = 0xFF; - white.bytes[2] = 0xFF; - white.bytes[3] = 0x00; - return 1; } @@ -178,7 +168,7 @@ FreeTransformManipulator::SetPreviewBitmap(BBitmap* bitmap) copy_of_the_preview_bitmap = DuplicateBitmap(preview_bitmap); } } - catch (std::bad_alloc e) { + catch (const std::bad_alloc& e) { preview_bitmap = NULL; copy_of_the_preview_bitmap = NULL; throw e; diff --git a/artpaint/viewmanipulators/Manipulator.cpp b/artpaint/viewmanipulators/Manipulator.cpp index 34466623..5e4b2a68 100644 --- a/artpaint/viewmanipulators/Manipulator.cpp +++ b/artpaint/viewmanipulators/Manipulator.cpp @@ -31,7 +31,7 @@ Manipulator::Manipulator() if (topoCount > 0) { cpu_topology_node_info topology[topoCount]; get_cpu_topology_info(topology, &topoCount); - for (int i = 0; i < topoCount; ++i) { + for (uint i = 0; i < topoCount; ++i) { if (topology[i].type == B_TOPOLOGY_CORE) fSystemClockSpeed += topology[i].data.core.default_frequency; } diff --git a/artpaint/viewmanipulators/Manipulator.h b/artpaint/viewmanipulators/Manipulator.h index 82bb9ad1..c16ba367 100644 --- a/artpaint/viewmanipulators/Manipulator.h +++ b/artpaint/viewmanipulators/Manipulator.h @@ -68,7 +68,7 @@ class Manipulator { double GetSystemClockSpeed() { return fSystemClockSpeed; } int GetSystemCpuCount() { return fCpuCount; } virtual void SetSelection(Selection* new_selection) = 0; - virtual BBitmap* ManipulateSelectionMap() { return NULL; } + virtual BBitmap* ManipulateSelectionBitmap() { return NULL; } protected: BBitmap* DuplicateBitmap(BBitmap* source, diff --git a/artpaint/viewmanipulators/RotationManipulator.cpp b/artpaint/viewmanipulators/RotationManipulator.cpp index e91158f1..c1163cbf 100644 --- a/artpaint/viewmanipulators/RotationManipulator.cpp +++ b/artpaint/viewmanipulators/RotationManipulator.cpp @@ -111,7 +111,7 @@ RotationManipulator::SetPreviewBitmap(BBitmap* bitmap) copy_of_the_preview_bitmap = NULL; } } - catch (std::bad_alloc e) { + catch (const std::bad_alloc& e) { preview_bitmap = NULL; copy_of_the_preview_bitmap = NULL; throw e; @@ -892,7 +892,6 @@ void RotationManipulatorConfigurationView::GetControlValues(float& angle) { BTextView* text_view = fTextControl->TextView(); - char float_text[256]; const char* text = text_view->Text(); int decimal_place = 0; float sign = 1; diff --git a/artpaint/viewmanipulators/ScaleCanvasManipulator.cpp b/artpaint/viewmanipulators/ScaleCanvasManipulator.cpp index 9bfe1816..167a5a45 100644 --- a/artpaint/viewmanipulators/ScaleCanvasManipulator.cpp +++ b/artpaint/viewmanipulators/ScaleCanvasManipulator.cpp @@ -132,7 +132,6 @@ ScaleCanvasManipulator::ManipulateBitmap( if (new_width != 0) diff = starting_width / new_width; - float accumulation = 0; int32 left = (int32)bounds.left; int32 top = (int32)bounds.top; int32 bottom = (int32)bounds.bottom; @@ -234,10 +233,10 @@ ScaleCanvasManipulator::PreviewBitmap(bool, BRegion* region) white.bytes[3] = 0x00; // Here do a DDA-scaling from copy_of_the_preview_bitmap to preview_bitmap. - uint32 width = preview_bitmap->Bounds().IntegerWidth(); - uint32 height = preview_bitmap->Bounds().IntegerHeight(); - uint32 source_width = copy_of_the_preview_bitmap->Bounds().IntegerWidth(); - uint32 source_height = copy_of_the_preview_bitmap->Bounds().IntegerHeight(); + int32 width = preview_bitmap->Bounds().IntegerWidth(); + int32 height = preview_bitmap->Bounds().IntegerHeight(); + int32 source_width = copy_of_the_preview_bitmap->Bounds().IntegerWidth(); + int32 source_height = copy_of_the_preview_bitmap->Bounds().IntegerHeight(); if (width == 0 || height == 0) return 0; @@ -387,7 +386,7 @@ ScaleCanvasManipulator::SetPreviewBitmap(BBitmap* bitmap) copy_of_the_preview_bitmap = DuplicateBitmap(preview_bitmap); } } - catch (std::bad_alloc e) { + catch (const std::bad_alloc& e) { preview_bitmap = NULL; copy_of_the_preview_bitmap = NULL; throw e; diff --git a/artpaint/viewmanipulators/ScaleManipulator.cpp b/artpaint/viewmanipulators/ScaleManipulator.cpp index bc4d3438..2aefc6c2 100644 --- a/artpaint/viewmanipulators/ScaleManipulator.cpp +++ b/artpaint/viewmanipulators/ScaleManipulator.cpp @@ -180,7 +180,7 @@ ScaleManipulator::ManipulateBitmap( if (new_width == starting_width && new_height == starting_height) { if (final_bitmap != NULL) delete final_bitmap; - final_bitmap = new BBitmap(preview_bitmap, B_RGBA32); + final_bitmap = new BBitmap(preview_bitmap); return final_bitmap; } @@ -202,7 +202,6 @@ ScaleManipulator::ManipulateBitmap( source_bits = (uint32*)original->Bits(); int32 source_bpr = original->BytesPerRow() / 4; float diff = starting_width / new_width; - float accumulation = 0; int32 bottom = (int32)bounds.bottom; for (int32 y = 0; y < starting_height; y++) @@ -277,7 +276,7 @@ ScaleManipulator::ManipulateBitmap( } source_bits = NULL; - uint32 source_bpr; + int32 source_bpr; BRect final_bounds(orig_bounds); BRect source_bounds; @@ -412,7 +411,7 @@ ScaleManipulator::ManipulateSelectionMap(ManipulatorSettings* set) if (new_width == starting_width && new_height == starting_height) { if (final_bitmap != NULL) delete final_bitmap; - final_bitmap = new BBitmap(selection_map, B_GRAY8); + final_bitmap = new BBitmap(selection_map); return final_bitmap; } @@ -501,7 +500,7 @@ ScaleManipulator::ManipulateSelectionMap(ManipulatorSettings* set) } source_bits = NULL; - uint32 source_bpr; + int32 source_bpr; BRect final_bounds(selection_map->Bounds()); BRect source_bounds; @@ -572,10 +571,10 @@ ScaleManipulator::PreviewBitmap(bool, BRegion* region) preview_bitmap->Lock(); // Here do a DDA-scaling from copy_of_the_preview_bitmap to preview_bitmap. - uint32 width = preview_bitmap->Bounds().IntegerWidth(); - uint32 height = preview_bitmap->Bounds().IntegerHeight(); - uint32 source_width = copy_of_the_preview_bitmap->Bounds().IntegerWidth(); - uint32 source_height = copy_of_the_preview_bitmap->Bounds().IntegerHeight(); + int32 width = preview_bitmap->Bounds().IntegerWidth(); + int32 height = preview_bitmap->Bounds().IntegerHeight(); + int32 source_width = copy_of_the_preview_bitmap->Bounds().IntegerWidth(); + int32 source_height = copy_of_the_preview_bitmap->Bounds().IntegerHeight(); if (width == 0 || height == 0) return 0; @@ -645,9 +644,6 @@ ScaleManipulator::PreviewBitmap(bool, BRegion* region) delete[] source_x_table; } else { - float new_x = new_width; - float new_y = new_height; - if (reject_mouse_input == true) return 1; @@ -916,7 +912,7 @@ ScaleManipulator::SetPreviewBitmap(BBitmap* bitmap) copy_of_the_preview_bitmap = DuplicateBitmap(preview_bitmap); } } - catch (std::bad_alloc e) { + catch (const std::bad_alloc& e) { preview_bitmap = NULL; copy_of_the_preview_bitmap = NULL; throw e; diff --git a/artpaint/viewmanipulators/TranslationManipulator.cpp b/artpaint/viewmanipulators/TranslationManipulator.cpp index 741ad5cc..30e5f8a2 100644 --- a/artpaint/viewmanipulators/TranslationManipulator.cpp +++ b/artpaint/viewmanipulators/TranslationManipulator.cpp @@ -40,9 +40,11 @@ TranslationManipulator::TranslationManipulator(BBitmap* bm) : WindowGUIManipulator(), copy_of_the_preview_bitmap(NULL), + settings(NULL), + config_view(NULL), selection(NULL), - transform_selection_only(false), - orig_selection_map(NULL) + orig_selection_map(NULL), + transform_selection_only(false) { preview_bitmap = bm; if (preview_bitmap != NULL) @@ -279,7 +281,6 @@ TranslationManipulator::ManipulateSelectionMap(ManipulatorSettings* set) selection_map->Lock(); uint8* source_bits = (uint8*)selection_map->Bits(); - uint32 source_bpr = selection_map->BytesPerRow(); selection_map->Unlock(); // We have to copy translations so that we do translation for all pixels diff --git a/artpaint/windows/BrushStoreWindow.cpp b/artpaint/windows/BrushStoreWindow.cpp index 931f85e8..bc8427cd 100644 --- a/artpaint/windows/BrushStoreWindow.cpp +++ b/artpaint/windows/BrushStoreWindow.cpp @@ -78,7 +78,7 @@ BrushStoreWindow::BrushStoreWindow() BView* brush_editor = BrushEditor::CreateBrushEditor(ToolManager::Instance().GetCurrentBrush()); - BGroupLayout* mainLayout = BLayoutBuilder::Group<>(this, B_VERTICAL, 0) + BLayoutBuilder::Group<>(this, B_VERTICAL, 0) .Add(menu_bar, 0.0) .AddGroup(B_VERTICAL) .Add(brush_editor) @@ -285,9 +285,8 @@ BrushStoreView::~BrushStoreView() delete a_bitmap; } - brush_info* info; while (brush_data->CountItems() > 0) { - info = (brush_info*)brush_data->RemoveItem((int32)0); + brush_data->RemoveItem((int32)0); } delete brush_images; diff --git a/artpaint/windows/GlobalSetupWindow.cpp b/artpaint/windows/GlobalSetupWindow.cpp index 6a6e69b4..b3bbc5b6 100644 --- a/artpaint/windows/GlobalSetupWindow.cpp +++ b/artpaint/windows/GlobalSetupWindow.cpp @@ -630,7 +630,6 @@ ColorSwatch::MessageReceived(BMessage* message) case B_PASTE: { if (message->WasDropped()) { - BPoint dropPoint = ConvertFromScreen(message->DropPoint()); ssize_t size; const void* data; if (message->FindData("RGBColor", B_RGB_COLOR_TYPE, &data, &size) == B_OK