From 6819b32be7903dbb086fbd5edb6a798803a49542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=B6ssie?= Date: Fri, 26 Aug 2022 11:54:12 +0200 Subject: [PATCH 1/4] Mute some warnings (#6563) --- rtengine/canon_cr3_decoder.cc | 2 + rtengine/dcraw.cc | 187 +++++++++++++++++----------------- rtengine/imageio.cc | 2 +- rtgui/main-cli.cc | 2 + rtgui/main.cc | 2 +- rtgui/rtimage.cc | 2 +- 6 files changed, 101 insertions(+), 96 deletions(-) diff --git a/rtengine/canon_cr3_decoder.cc b/rtengine/canon_cr3_decoder.cc index b5f04a1c8..c5b137192 100644 --- a/rtengine/canon_cr3_decoder.cc +++ b/rtengine/canon_cr3_decoder.cc @@ -2759,6 +2759,7 @@ bool crxMakeQStep(CrxImage *img, CrxTile *tile, std::int32_t *qpTable, std::uint } // continue to the next level - we always decode all levels ++qStep; + // fall through case 2: qStep->qStepTbl = qStepTbl; qStep->width = qpWidth; @@ -2777,6 +2778,7 @@ bool crxMakeQStep(CrxImage *img, CrxTile *tile, std::int32_t *qpTable, std::uint } // continue to the next level - we always decode all levels ++qStep; + // fall through case 1: qStep->qStepTbl = qStepTbl; qStep->width = qpWidth; diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index e4dbcbf94..64a623132 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -2823,7 +2823,7 @@ void CLASS kodak_radc_load_raw() FORC3 { val = ((0x1000000/last[c] + 0x7ff) >> 12) * mul[c]; s = val > 65564 ? 10:12; - x = ~(-1 << (s-1)); + x = ~(~0U << (s-1)); val <<= 12-s; for (i=0; i < sizeof(buf[0])/sizeof(short); i++) ((short *)buf[c])[i] = (((short *)buf[c])[i] * val + x) >> s; @@ -3499,7 +3499,7 @@ void CLASS smal_decode_segment (unsigned seg[2][2], int holes) if ((data >> nbits & 0xff) == 0xff) break; if (nbits > 0) data = ((data & ((1 << (nbits-1)) - 1)) << 1) | - ((data + (((data & (1 << (nbits-1)))) << 1)) & (-1 << nbits)); + ((data + (((data & (1 << (nbits-1)))) << 1)) & (~0U << nbits)); if (nbits >= 0) { data += getbits(1); carry = nbits - 8; @@ -7323,7 +7323,7 @@ void CLASS ciff_block_1030() bitbuf = bitbuf << 16 | (get2() ^ key[i++ & 1]); vbits += 16; } - white[row][col] = bitbuf >> (vbits -= bpp) & ~(-1 << bpp); + white[row][col] = bitbuf >> (vbits -= bpp) & ~(~0U << bpp); } } @@ -7762,7 +7762,7 @@ void CLASS parse_cine() } cam_mul[0] = getreal(11); cam_mul[2] = getreal(11); - maximum = ~(-1 << get4()); + maximum = ~(~0U << get4()); fseek (ifp, 668, SEEK_CUR); shutter = get4()/1000000000.0; fseek (ifp, off_image, SEEK_SET); @@ -9360,107 +9360,108 @@ void CLASS identify() char make[10], model[20]; ushort offset; } table[] = { - { 786432,1024, 768, 0, 0, 0, 0, 0,0x94,0,0,"AVT","F-080C" }, - { 1447680,1392,1040, 0, 0, 0, 0, 0,0x94,0,0,"AVT","F-145C" }, - { 1920000,1600,1200, 0, 0, 0, 0, 0,0x94,0,0,"AVT","F-201C" }, - { 5067304,2588,1958, 0, 0, 0, 0, 0,0x94,0,0,"AVT","F-510C" }, + { 786432,1024, 768, 0, 0, 0, 0, 0,0x94,0,0,"AVT","F-080C",0 }, + { 1447680,1392,1040, 0, 0, 0, 0, 0,0x94,0,0,"AVT","F-145C",0 }, + { 1920000,1600,1200, 0, 0, 0, 0, 0,0x94,0,0,"AVT","F-201C",0 }, + { 5067304,2588,1958, 0, 0, 0, 0, 0,0x94,0,0,"AVT","F-510C",0 }, { 5067316,2588,1958, 0, 0, 0, 0, 0,0x94,0,0,"AVT","F-510C",12 }, - { 10134608,2588,1958, 0, 0, 0, 0, 9,0x94,0,0,"AVT","F-510C" }, + { 10134608,2588,1958, 0, 0, 0, 0, 9,0x94,0,0,"AVT","F-510C",0 }, { 10134620,2588,1958, 0, 0, 0, 0, 9,0x94,0,0,"AVT","F-510C",12 }, - { 16157136,3272,2469, 0, 0, 0, 0, 9,0x94,0,0,"AVT","F-810C" }, - { 15980544,3264,2448, 0, 0, 0, 0, 8,0x61,0,1,"AgfaPhoto","DC-833m" }, - { 9631728,2532,1902, 0, 0, 0, 0,96,0x61,0,0,"Alcatel","5035D" }, + { 16157136,3272,2469, 0, 0, 0, 0, 9,0x94,0,0,"AVT","F-810C",0 }, + { 15980544,3264,2448, 0, 0, 0, 0, 8,0x61,0,1,"AgfaPhoto","DC-833m",0 }, + { 9631728,2532,1902, 0, 0, 0, 0,96,0x61,0,0,"Alcatel","5035D",0 }, { 2868726,1384,1036, 0, 0, 0, 0,64,0x49,0,8,"Baumer","TXG14",1078 }, - { 5298000,2400,1766,12,12,44, 2, 8,0x94,0,2,"Canon","PowerShot SD300" }, - { 6553440,2664,1968, 4, 4,44, 4, 8,0x94,0,2,"Canon","PowerShot A460" }, - { 6573120,2672,1968,12, 8,44, 0, 8,0x94,0,2,"Canon","PowerShot A610" }, - { 6653280,2672,1992,10, 6,42, 2, 8,0x94,0,2,"Canon","PowerShot A530" }, - { 7710960,2888,2136,44, 8, 4, 0, 8,0x94,0,2,"Canon","PowerShot S3 IS" }, - { 9219600,3152,2340,36,12, 4, 0, 8,0x94,0,2,"Canon","PowerShot A620" }, - { 9243240,3152,2346,12, 7,44,13, 8,0x49,0,2,"Canon","PowerShot A470" }, - { 10341600,3336,2480, 6, 5,32, 3, 8,0x94,0,2,"Canon","PowerShot A720 IS" }, - { 10383120,3344,2484,12, 6,44, 6, 8,0x94,0,2,"Canon","PowerShot A630" }, - { 12945240,3736,2772,12, 6,52, 6, 8,0x94,0,2,"Canon","PowerShot A640" }, - { 15636240,4104,3048,48,12,24,12, 8,0x94,0,2,"Canon","PowerShot A650" }, - { 15467760,3720,2772, 6,12,30, 0, 8,0x94,0,2,"Canon","PowerShot SX110 IS" }, - { 15534576,3728,2778,12, 9,44, 9, 8,0x94,0,2,"Canon","PowerShot SX120 IS" }, - { 18653760,4080,3048,24,12,24,12, 8,0x94,0,2,"Canon","PowerShot SX20 IS" }, - { 19131120,4168,3060,92,16, 4, 1, 8,0x94,0,2,"Canon","PowerShot SX220 HS" }, - { 21936096,4464,3276,25,10,73,12, 8,0x16,0,2,"Canon","PowerShot SX30 IS" }, - { 24724224,4704,3504, 8,16,56, 8, 8,0x94,0,2,"Canon","PowerShot A3300 IS" }, - { 30858240,5248,3920, 8,16,56,16, 8,0x94,0,2,"Canon","IXUS 160" }, { 1976352,1632,1211, 0, 2, 0, 1, 0,0x94,0,1,"Casio","QV-2000UX" }, - { 3217760,2080,1547, 0, 0,10, 1, 0,0x94,0,1,"Casio","QV-3*00EX" }, - { 6218368,2585,1924, 0, 0, 9, 0, 0,0x94,0,1,"Casio","QV-5700" }, - { 7816704,2867,2181, 0, 0,34,36, 0,0x16,0,1,"Casio","EX-Z60" }, - { 2937856,1621,1208, 0, 0, 1, 0, 0,0x94,7,13,"Casio","EX-S20" }, - { 4948608,2090,1578, 0, 0,32,34, 0,0x94,7,1,"Casio","EX-S100" }, - { 6054400,2346,1720, 2, 0,32, 0, 0,0x94,7,1,"Casio","QV-R41" }, - { 7426656,2568,1928, 0, 0, 0, 0, 0,0x94,0,1,"Casio","EX-P505" }, - { 7530816,2602,1929, 0, 0,22, 0, 0,0x94,7,1,"Casio","QV-R51" }, - { 7542528,2602,1932, 0, 0,32, 0, 0,0x94,7,1,"Casio","EX-Z50" }, - { 7562048,2602,1937, 0, 0,25, 0, 0,0x16,7,1,"Casio","EX-Z500" }, - { 7753344,2602,1986, 0, 0,32,26, 0,0x94,7,1,"Casio","EX-Z55" }, - { 9313536,2858,2172, 0, 0,14,30, 0,0x94,7,1,"Casio","EX-P600" }, - { 10834368,3114,2319, 0, 0,27, 0, 0,0x94,0,1,"Casio","EX-Z750" }, - { 10843712,3114,2321, 0, 0,25, 0, 0,0x94,0,1,"Casio","EX-Z75" }, - { 10979200,3114,2350, 0, 0,32,32, 0,0x94,7,1,"Casio","EX-P700" }, - { 12310144,3285,2498, 0, 0, 6,30, 0,0x94,0,1,"Casio","EX-Z850" }, - { 12489984,3328,2502, 0, 0,47,35, 0,0x94,0,1,"Casio","EX-Z8" }, - { 15499264,3754,2752, 0, 0,82, 0, 0,0x94,0,1,"Casio","EX-Z1050" }, - { 18702336,4096,3044, 0, 0,24, 0,80,0x94,7,1,"Casio","EX-ZR100" }, - { 7684000,2260,1700, 0, 0, 0, 0,13,0x94,0,1,"Casio","QV-4000" }, - { 787456,1024, 769, 0, 1, 0, 0, 0,0x49,0,0,"Creative","PC-CAM 600" }, - { 28829184,4384,3288, 0, 0, 0, 0,36,0x61,0,0,"DJI" }, - { 15151104,4608,3288, 0, 0, 0, 0, 0,0x94,0,0,"Matrix" }, - { 3840000,1600,1200, 0, 0, 0, 0,65,0x49,0,0,"Foculus","531C" }, - { 307200, 640, 480, 0, 0, 0, 0, 0,0x94,0,0,"Generic" }, - { 62464, 256, 244, 1, 1, 6, 1, 0,0x8d,0,0,"Kodak","DC20" }, - { 124928, 512, 244, 1, 1,10, 1, 0,0x8d,0,0,"Kodak","DC20" }, - { 1652736,1536,1076, 0,52, 0, 0, 0,0x61,0,0,"Kodak","DCS200" }, - { 4159302,2338,1779, 1,33, 1, 2, 0,0x94,0,0,"Kodak","C330" }, + { 5298000,2400,1766,12,12,44, 2, 8,0x94,0,2,"Canon","PowerShot SD300",0 }, + { 6553440,2664,1968, 4, 4,44, 4, 8,0x94,0,2,"Canon","PowerShot A460",0 }, + { 6573120,2672,1968,12, 8,44, 0, 8,0x94,0,2,"Canon","PowerShot A610",0 }, + { 6653280,2672,1992,10, 6,42, 2, 8,0x94,0,2,"Canon","PowerShot A530",0 }, + { 7710960,2888,2136,44, 8, 4, 0, 8,0x94,0,2,"Canon","PowerShot S3 IS",0 }, + { 9219600,3152,2340,36,12, 4, 0, 8,0x94,0,2,"Canon","PowerShot A620",0 }, + { 9243240,3152,2346,12, 7,44,13, 8,0x49,0,2,"Canon","PowerShot A470",0 }, + { 10341600,3336,2480, 6, 5,32, 3, 8,0x94,0,2,"Canon","PowerShot A720 IS",0 }, + { 10383120,3344,2484,12, 6,44, 6, 8,0x94,0,2,"Canon","PowerShot A630",0 }, + { 12945240,3736,2772,12, 6,52, 6, 8,0x94,0,2,"Canon","PowerShot A640",0 }, + { 15636240,4104,3048,48,12,24,12, 8,0x94,0,2,"Canon","PowerShot A650",0 }, + { 15467760,3720,2772, 6,12,30, 0, 8,0x94,0,2,"Canon","PowerShot SX110 IS",0 }, + { 15534576,3728,2778,12, 9,44, 9, 8,0x94,0,2,"Canon","PowerShot SX120 IS",0 }, + { 18653760,4080,3048,24,12,24,12, 8,0x94,0,2,"Canon","PowerShot SX20 IS",0 }, + { 19131120,4168,3060,92,16, 4, 1, 8,0x94,0,2,"Canon","PowerShot SX220 HS",0 }, + { 21936096,4464,3276,25,10,73,12, 8,0x16,0,2,"Canon","PowerShot SX30 IS",0 }, + { 24724224,4704,3504, 8,16,56, 8, 8,0x94,0,2,"Canon","PowerShot A3300 IS",0 }, + { 30858240,5248,3920, 8,16,56,16, 8,0x94,0,2,"Canon","IXUS 160",0 }, + { 1976352,1632,1211, 0, 2, 0, 1, 0,0x94,0,1,"Casio","QV-2000UX",0 }, + { 3217760,2080,1547, 0, 0,10, 1, 0,0x94,0,1,"Casio","QV-3*00EX",0 }, + { 6218368,2585,1924, 0, 0, 9, 0, 0,0x94,0,1,"Casio","QV-5700",0 }, + { 7816704,2867,2181, 0, 0,34,36, 0,0x16,0,1,"Casio","EX-Z60",0 }, + { 2937856,1621,1208, 0, 0, 1, 0, 0,0x94,7,13,"Casio","EX-S20",0 }, + { 4948608,2090,1578, 0, 0,32,34, 0,0x94,7,1,"Casio","EX-S100",0 }, + { 6054400,2346,1720, 2, 0,32, 0, 0,0x94,7,1,"Casio","QV-R41",0 }, + { 7426656,2568,1928, 0, 0, 0, 0, 0,0x94,0,1,"Casio","EX-P505",0 }, + { 7530816,2602,1929, 0, 0,22, 0, 0,0x94,7,1,"Casio","QV-R51",0 }, + { 7542528,2602,1932, 0, 0,32, 0, 0,0x94,7,1,"Casio","EX-Z50",0 }, + { 7562048,2602,1937, 0, 0,25, 0, 0,0x16,7,1,"Casio","EX-Z500",0 }, + { 7753344,2602,1986, 0, 0,32,26, 0,0x94,7,1,"Casio","EX-Z55",0 }, + { 9313536,2858,2172, 0, 0,14,30, 0,0x94,7,1,"Casio","EX-P600",0 }, + { 10834368,3114,2319, 0, 0,27, 0, 0,0x94,0,1,"Casio","EX-Z750",0 }, + { 10843712,3114,2321, 0, 0,25, 0, 0,0x94,0,1,"Casio","EX-Z75",0 }, + { 10979200,3114,2350, 0, 0,32,32, 0,0x94,7,1,"Casio","EX-P700",0 }, + { 12310144,3285,2498, 0, 0, 6,30, 0,0x94,0,1,"Casio","EX-Z850",0 }, + { 12489984,3328,2502, 0, 0,47,35, 0,0x94,0,1,"Casio","EX-Z8",0 }, + { 15499264,3754,2752, 0, 0,82, 0, 0,0x94,0,1,"Casio","EX-Z1050",0 }, + { 18702336,4096,3044, 0, 0,24, 0,80,0x94,7,1,"Casio","EX-ZR100",0 }, + { 7684000,2260,1700, 0, 0, 0, 0,13,0x94,0,1,"Casio","QV-4000",0 }, + { 787456,1024, 769, 0, 1, 0, 0, 0,0x49,0,0,"Creative","PC-CAM 600",0 }, + { 28829184,4384,3288, 0, 0, 0, 0,36,0x61,0,0,"DJI",0 }, + { 15151104,4608,3288, 0, 0, 0, 0, 0,0x94,0,0,"Matrix",0 }, + { 3840000,1600,1200, 0, 0, 0, 0,65,0x49,0,0,"Foculus","531C",0 }, + { 307200, 640, 480, 0, 0, 0, 0, 0,0x94,0,0,"Generic",0 }, + { 62464, 256, 244, 1, 1, 6, 1, 0,0x8d,0,0,"Kodak","DC20",0 }, + { 124928, 512, 244, 1, 1,10, 1, 0,0x8d,0,0,"Kodak","DC20",0 }, + { 1652736,1536,1076, 0,52, 0, 0, 0,0x61,0,0,"Kodak","DCS200",0 }, + { 4159302,2338,1779, 1,33, 1, 2, 0,0x94,0,0,"Kodak","C330",0 }, { 4162462,2338,1779, 1,33, 1, 2, 0,0x94,0,0,"Kodak","C330",3160 }, - { 2247168,1232, 912, 0, 0,16, 0, 0,0x00,0,0,"Kodak","C330" }, - { 3370752,1232, 912, 0, 0,16, 0, 0,0x00,0,0,"Kodak","C330" }, - { 6163328,2864,2152, 0, 0, 0, 0, 0,0x94,0,0,"Kodak","C603" }, + { 2247168,1232, 912, 0, 0,16, 0, 0,0x00,0,0,"Kodak","C330",0 }, + { 3370752,1232, 912, 0, 0,16, 0, 0,0x00,0,0,"Kodak","C330",0 }, + { 6163328,2864,2152, 0, 0, 0, 0, 0,0x94,0,0,"Kodak","C603",0 }, { 6166488,2864,2152, 0, 0, 0, 0, 0,0x94,0,0,"Kodak","C603",3160 }, - { 460800, 640, 480, 0, 0, 0, 0, 0,0x00,0,0,"Kodak","C603" }, - { 9116448,2848,2134, 0, 0, 0, 0, 0,0x00,0,0,"Kodak","C603" }, - { 12241200,4040,3030, 2, 0, 0,13, 0,0x49,0,0,"Kodak","12MP" }, + { 460800, 640, 480, 0, 0, 0, 0, 0,0x00,0,0,"Kodak","C603",0 }, + { 9116448,2848,2134, 0, 0, 0, 0, 0,0x00,0,0,"Kodak","C603",0 }, + { 12241200,4040,3030, 2, 0, 0,13, 0,0x49,0,0,"Kodak","12MP",0 }, { 12272756,4040,3030, 2, 0, 0,13, 0,0x49,0,0,"Kodak","12MP",31556 }, - { 18000000,4000,3000, 0, 0, 0, 0, 0,0x00,0,0,"Kodak","12MP" }, - { 614400, 640, 480, 0, 3, 0, 0,64,0x94,0,0,"Kodak","KAI-0340" }, - { 15360000,3200,2400, 0, 0, 0, 0,96,0x16,0,0,"Lenovo","A820" }, + { 18000000,4000,3000, 0, 0, 0, 0, 0,0x00,0,0,"Kodak","12MP",0 }, + { 614400, 640, 480, 0, 3, 0, 0,64,0x94,0,0,"Kodak","KAI-0340",0 }, + { 15360000,3200,2400, 0, 0, 0, 0,96,0x16,0,0,"Lenovo","A820",0 }, { 3884928,1608,1207, 0, 0, 0, 0,96,0x16,0,0,"Micron","2010",3212 }, { 1138688,1534, 986, 0, 0, 0, 0, 0,0x61,0,0,"Minolta","RD175",513 }, - { 1581060,1305, 969, 0, 0,18, 6, 6,0x1e,4,1,"Nikon","E900" }, - { 2465792,1638,1204, 0, 0,22, 1, 6,0x4b,5,1,"Nikon","E950" }, - { 2940928,1616,1213, 0, 0, 0, 7,30,0x94,0,1,"Nikon","E2100" }, - { 4771840,2064,1541, 0, 0, 0, 1, 6,0xe1,0,1,"Nikon","E990" }, - { 4775936,2064,1542, 0, 0, 0, 0,30,0x94,0,1,"Nikon","E3700" }, - { 5865472,2288,1709, 0, 0, 0, 1, 6,0xb4,0,1,"Nikon","E4500" }, - { 5869568,2288,1710, 0, 0, 0, 0, 6,0x16,0,1,"Nikon","E4300" }, - { 7438336,2576,1925, 0, 0, 0, 1, 6,0xb4,0,1,"Nikon","E5000" }, - { 8998912,2832,2118, 0, 0, 0, 0,30,0x94,7,1,"Nikon","COOLPIX S6" }, - { 5939200,2304,1718, 0, 0, 0, 0,30,0x16,0,0,"Olympus","C770UZ" }, - { 3178560,2064,1540, 0, 0, 0, 0, 0,0x94,0,1,"Pentax","Optio S" }, - { 4841984,2090,1544, 0, 0,22, 0, 0,0x94,7,1,"Pentax","Optio S" }, - { 6114240,2346,1737, 0, 0,22, 0, 0,0x94,7,1,"Pentax","Optio S4" }, - { 10702848,3072,2322, 0, 0, 0,21,30,0x94,0,1,"Pentax","Optio 750Z" }, - { 4147200,1920,1080, 0, 0, 0, 0, 0,0x49,0,0,"Photron","BC2-HD" }, + { 1581060,1305, 969, 0, 0,18, 6, 6,0x1e,4,1,"Nikon","E900",0 }, + { 2465792,1638,1204, 0, 0,22, 1, 6,0x4b,5,1,"Nikon","E950",0 }, + { 2940928,1616,1213, 0, 0, 0, 7,30,0x94,0,1,"Nikon","E2100",0 }, + { 4771840,2064,1541, 0, 0, 0, 1, 6,0xe1,0,1,"Nikon","E990",0 }, + { 4775936,2064,1542, 0, 0, 0, 0,30,0x94,0,1,"Nikon","E3700",0 }, + { 5865472,2288,1709, 0, 0, 0, 1, 6,0xb4,0,1,"Nikon","E4500",0 }, + { 5869568,2288,1710, 0, 0, 0, 0, 6,0x16,0,1,"Nikon","E4300",0 }, + { 7438336,2576,1925, 0, 0, 0, 1, 6,0xb4,0,1,"Nikon","E5000",0 }, + { 8998912,2832,2118, 0, 0, 0, 0,30,0x94,7,1,"Nikon","COOLPIX S6",0 }, + { 5939200,2304,1718, 0, 0, 0, 0,30,0x16,0,0,"Olympus","C770UZ",0 }, + { 3178560,2064,1540, 0, 0, 0, 0, 0,0x94,0,1,"Pentax","Optio S",0 }, + { 4841984,2090,1544, 0, 0,22, 0, 0,0x94,7,1,"Pentax","Optio S",0 }, + { 6114240,2346,1737, 0, 0,22, 0, 0,0x94,7,1,"Pentax","Optio S4",0 }, + { 10702848,3072,2322, 0, 0, 0,21,30,0x94,0,1,"Pentax","Optio 750Z",0 }, + { 4147200,1920,1080, 0, 0, 0, 0, 0,0x49,0,0,"Photron","BC2-HD",0 }, { 4151666,1920,1080, 0, 0, 0, 0, 0,0x49,0,0,"Photron","BC2-HD",8 }, - { 13248000,2208,3000, 0, 0, 0, 0,13,0x61,0,0,"Pixelink","A782" }, - { 6291456,2048,1536, 0, 0, 0, 0,96,0x61,0,0,"RoverShot","3320AF" }, - { 311696, 644, 484, 0, 0, 0, 0, 0,0x16,0,8,"ST Micro","STV680 VGA" }, - { 16098048,3288,2448, 0, 0,24, 0, 9,0x94,0,1,"Samsung","S85" }, - { 16215552,3312,2448, 0, 0,48, 0, 9,0x94,0,1,"Samsung","S85" }, - { 20487168,3648,2808, 0, 0, 0, 0,13,0x94,5,1,"Samsung","WB550" }, - { 24000000,4000,3000, 0, 0, 0, 0,13,0x94,5,1,"Samsung","WB550" }, + { 13248000,2208,3000, 0, 0, 0, 0,13,0x61,0,0,"Pixelink","A782",0 }, + { 6291456,2048,1536, 0, 0, 0, 0,96,0x61,0,0,"RoverShot","3320AF",0 }, + { 311696, 644, 484, 0, 0, 0, 0, 0,0x16,0,8,"ST Micro","STV680 VGA",0 }, + { 16098048,3288,2448, 0, 0,24, 0, 9,0x94,0,1,"Samsung","S85",0 }, + { 16215552,3312,2448, 0, 0,48, 0, 9,0x94,0,1,"Samsung","S85",0 }, + { 20487168,3648,2808, 0, 0, 0, 0,13,0x94,5,1,"Samsung","WB550",0 }, + { 24000000,4000,3000, 0, 0, 0, 0,13,0x94,5,1,"Samsung","WB550",0 }, { 12582980,3072,2048, 0, 0, 0, 0,33,0x61,0,0,"Sinar","",68 }, { 33292868,4080,4080, 0, 0, 0, 0,33,0x61,0,0,"Sinar","",68 }, { 44390468,4080,5440, 0, 0, 0, 0,33,0x61,0,0,"Sinar","",68 }, - { 1409024,1376,1024, 0, 0, 1, 0, 0,0x49,0,0,"Sony","XCD-SX910CR" }, - { 2818048,1376,1024, 0, 0, 1, 0,97,0x49,0,0,"Sony","XCD-SX910CR" }, - { 17496000,4320,3240, 0, 0, 0,0,224,0x94,0,0,"Xiro","Xplorer V" }, + { 1409024,1376,1024, 0, 0, 1, 0, 0,0x49,0,0,"Sony","XCD-SX910CR",0 }, + { 2818048,1376,1024, 0, 0, 1, 0,97,0x49,0,0,"Sony","XCD-SX910CR",0 }, + { 17496000,4320,3240, 0, 0, 0,0,224,0x94,0,0,"Xiro","Xplorer V",0 }, }; static const char *corp[] = { "AgfaPhoto", "Canon", "Casio", "Epson", "Fujifilm", diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc index ce44d1ff4..ca41aa007 100644 --- a/rtengine/imageio.cc +++ b/rtengine/imageio.cc @@ -999,7 +999,7 @@ void PNGwriteRawProfile(png_struct *ping, png_info *ping_info, const char *profi } // namespace -int ImageIO::savePNG (const Glib::ustring &fname, int bps) const +int ImageIO::savePNG (const Glib::ustring &fname, volatile int bps) const { if (getWidth() < 1 || getHeight() < 1) { return IMIO_HEADERERROR; diff --git a/rtgui/main-cli.cc b/rtgui/main-cli.cc index feef93564..b2a0d5750 100644 --- a/rtgui/main-cli.cc +++ b/rtgui/main-cli.cc @@ -290,6 +290,7 @@ int processLineParams ( int argc, char **argv ) case 'O': copyParamsFile = true; + // fall through case 'o': // outputfile or dir if ( iArg + 1 < argc ) { @@ -341,6 +342,7 @@ int processLineParams ( int argc, char **argv ) case 'S': skipIfNoSidecar = true; + // fall through case 's': // Processing params next to file (file extension appended) sideProcParams = true; diff --git a/rtgui/main.cc b/rtgui/main.cc index 9f623a6df..ebbb480c9 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -169,7 +169,7 @@ int processLineParams ( int argc, char **argv ) break; } - // no break here on purpose + // fall through case 'h': case '?': diff --git a/rtgui/rtimage.cc b/rtgui/rtimage.cc index 44078ed3b..49551d5e6 100644 --- a/rtgui/rtimage.cc +++ b/rtgui/rtimage.cc @@ -38,7 +38,7 @@ int RTImage::scaleBack = 0; RTImage::RTImage () {} -RTImage::RTImage (RTImage &other) : surface(other.surface), pixbuf(other.pixbuf) +RTImage::RTImage (RTImage &other) : Gtk::Image(), surface(other.surface), pixbuf(other.pixbuf) { if (pixbuf) { set(pixbuf); From 4b97a5cf3c0d124c90fb8eae989facefff8024c5 Mon Sep 17 00:00:00 2001 From: Lawrence Lee <45837045+Lawrence37@users.noreply.github.com> Date: Mon, 5 Sep 2022 18:05:35 -0700 Subject: [PATCH 2/4] Placate some GCC warnings (#6563) --- rtengine/imagedata.cc | 3 ++- rtengine/imageio.cc | 23 ++++++++++++----------- rtgui/myflatcurve.cc | 8 ++------ rtgui/rtimage.cc | 2 +- 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/rtengine/imagedata.cc b/rtengine/imagedata.cc index 3c10e7dc0..5d3fef80b 100644 --- a/rtengine/imagedata.cc +++ b/rtengine/imagedata.cc @@ -16,6 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ +#include #include #include @@ -601,7 +602,7 @@ FrameData::FrameData(rtexif::TagDirectory* frameRootDir_, rtexif::TagDirectory* // ----------------------- Special file type detection (HDR, PixelShift) ------------------------ - uint16 bitspersample = 0, samplesperpixel = 0, sampleformat = 0, photometric = 0, compression = 0; + uint16_t bitspersample = 0, samplesperpixel = 0, sampleformat = 0, photometric = 0, compression = 0; const rtexif::Tag* const bps = frameRootDir->findTag("BitsPerSample"); const rtexif::Tag* const spp = frameRootDir->findTag("SamplesPerPixel"); const rtexif::Tag* const sf = frameRootDir->findTag("SampleFormat"); diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc index ca41aa007..39ab679e9 100644 --- a/rtengine/imageio.cc +++ b/rtengine/imageio.cc @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -664,7 +665,7 @@ int ImageIO::getTIFFSampleFormat (const Glib::ustring &fname, IIOSampleFormat &s return IMIO_CANNOTREADFILE; } - uint16 bitspersample = 0, samplesperpixel = 0, sampleformat = 0; + uint16_t bitspersample = 0, samplesperpixel = 0, sampleformat = 0; int hasTag = TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bitspersample); hasTag &= TIFFGetField(in, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel); @@ -689,7 +690,7 @@ int ImageIO::getTIFFSampleFormat (const Glib::ustring &fname, IIOSampleFormat &s sampleformat = SAMPLEFORMAT_UINT; } - uint16 config; + uint16_t config; TIFFGetField(in, TIFFTAG_PLANARCONFIG, &config); if (config == PLANARCONFIG_CONTIG) { @@ -701,14 +702,14 @@ int ImageIO::getTIFFSampleFormat (const Glib::ustring &fname, IIOSampleFormat &s return IMIO_VARIANTNOTSUPPORTED; } - uint16 photometric; + uint16_t photometric; if (!TIFFGetField(in, TIFFTAG_PHOTOMETRIC, &photometric)) { TIFFClose(in); return IMIO_VARIANTNOTSUPPORTED; } - uint16 compression; + uint16_t compression; if (photometric == PHOTOMETRIC_LOGLUV) if (!TIFFGetField(in, TIFFTAG_COMPRESSION, &compression)) { @@ -786,7 +787,7 @@ int ImageIO::loadTIFF (const Glib::ustring &fname) TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width); TIFFGetField(in, TIFFTAG_IMAGELENGTH, &height); - uint16 bitspersample, samplesperpixel; + uint16_t bitspersample, samplesperpixel; int hasTag = TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bitspersample); hasTag &= TIFFGetField(in, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel); @@ -798,7 +799,7 @@ int ImageIO::loadTIFF (const Glib::ustring &fname) return IMIO_VARIANTNOTSUPPORTED; } - uint16 config; + uint16_t config; TIFFGetField(in, TIFFTAG_PLANARCONFIG, &config); if (config != PLANARCONFIG_CONTIG) { @@ -819,7 +820,7 @@ int ImageIO::loadTIFF (const Glib::ustring &fname) */ if (settings->verbose) { printf("Information of \"%s\":\n", fname.c_str()); - uint16 tiffDefaultScale, tiffBaselineExposure, tiffLinearResponseLimit; + uint16_t tiffDefaultScale, tiffBaselineExposure, tiffLinearResponseLimit; if (TIFFGetField(in, TIFFTAG_DEFAULTSCALE, &tiffDefaultScale)) { printf(" DefaultScale: %d\n", tiffDefaultScale); } @@ -836,7 +837,7 @@ int ImageIO::loadTIFF (const Glib::ustring &fname) else printf(" No LinearResponseLimit value!\n"); - uint16 tiffMinValue, tiffMaxValue; + uint16_t tiffMinValue, tiffMaxValue; if (TIFFGetField(in, TIFFTAG_SMINSAMPLEVALUE, &tiffMinValue)) { printf(" MinValue: %d\n", tiffMinValue); } @@ -1556,15 +1557,15 @@ int ImageIO::saveTIFF (const Glib::ustring &fname, int bps, bool isFloat, bool u */ if (applyExifPatch) { unsigned char b[10]; - uint16 tagCount = 0; + uint16_t tagCount = 0; lseek(fileno, 4, SEEK_SET); read(fileno, b, 4); - uint32 ifd0Offset = rtexif::sget4(b, exifRoot->getOrder()); + uint32_t ifd0Offset = rtexif::sget4(b, exifRoot->getOrder()); lseek(fileno, ifd0Offset, SEEK_SET); read(fileno, b, 2); tagCount = rtexif::sget2(b, exifRoot->getOrder()); for (size_t i = 0; i < tagCount ; ++i) { - uint16 tagID = 0; + uint16_t tagID = 0; read(fileno, b, 2); tagID = rtexif::sget2(b, exifRoot->getOrder()); if (tagID == 0x8769) { diff --git a/rtgui/myflatcurve.cc b/rtgui/myflatcurve.cc index 11d89ebd8..8ccc28c21 100644 --- a/rtgui/myflatcurve.cc +++ b/rtgui/myflatcurve.cc @@ -1643,7 +1643,8 @@ void MyFlatCurve::movePoint(bool moveX, bool moveY, bool pipetteDrag) void MyFlatCurve::getCursorPosition(Gdk::EventType evType, bool isHint, int evX, int evY, Gdk::ModifierType modifierKey) { int tx, ty; - int prevCursorX, prevCursorY; + int prevCursorX = cursorX; + int prevCursorY = cursorY; double incrementX = 1. / double(graphW); double incrementY = 1. / double(graphH); @@ -1672,11 +1673,6 @@ void MyFlatCurve::getCursorPosition(Gdk::EventType evType, bool isHint, int evX, break; } - if (editedHandle != FCT_EditedHandle_None) { - prevCursorX = cursorX; - prevCursorY = cursorY; - } - cursorX = tx - graphX; cursorY = graphY - ty; diff --git a/rtgui/rtimage.cc b/rtgui/rtimage.cc index 49551d5e6..13dd22a7b 100644 --- a/rtgui/rtimage.cc +++ b/rtgui/rtimage.cc @@ -38,7 +38,7 @@ int RTImage::scaleBack = 0; RTImage::RTImage () {} -RTImage::RTImage (RTImage &other) : Gtk::Image(), surface(other.surface), pixbuf(other.pixbuf) +RTImage::RTImage (RTImage &other) : sigc::trackable(), Glib::ObjectBase(), Gtk::Image(), surface(other.surface), pixbuf(other.pixbuf) { if (pixbuf) { set(pixbuf); From aa02ee8c49f3eddaf4e4ccaace59ef60354a1b12 Mon Sep 17 00:00:00 2001 From: Lawrence Lee <45837045+Lawrence37@users.noreply.github.com> Date: Thu, 8 Sep 2022 23:14:16 -0700 Subject: [PATCH 3/4] Qualify some std integer types --- rtengine/imagedata.cc | 2 +- rtengine/imageio.cc | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/rtengine/imagedata.cc b/rtengine/imagedata.cc index 5d3fef80b..0556c4456 100644 --- a/rtengine/imagedata.cc +++ b/rtengine/imagedata.cc @@ -602,7 +602,7 @@ FrameData::FrameData(rtexif::TagDirectory* frameRootDir_, rtexif::TagDirectory* // ----------------------- Special file type detection (HDR, PixelShift) ------------------------ - uint16_t bitspersample = 0, samplesperpixel = 0, sampleformat = 0, photometric = 0, compression = 0; + std::uint16_t bitspersample = 0, samplesperpixel = 0, sampleformat = 0, photometric = 0, compression = 0; const rtexif::Tag* const bps = frameRootDir->findTag("BitsPerSample"); const rtexif::Tag* const spp = frameRootDir->findTag("SamplesPerPixel"); const rtexif::Tag* const sf = frameRootDir->findTag("SampleFormat"); diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc index 39ab679e9..646a11b4d 100644 --- a/rtengine/imageio.cc +++ b/rtengine/imageio.cc @@ -665,7 +665,7 @@ int ImageIO::getTIFFSampleFormat (const Glib::ustring &fname, IIOSampleFormat &s return IMIO_CANNOTREADFILE; } - uint16_t bitspersample = 0, samplesperpixel = 0, sampleformat = 0; + std::uint16_t bitspersample = 0, samplesperpixel = 0, sampleformat = 0; int hasTag = TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bitspersample); hasTag &= TIFFGetField(in, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel); @@ -690,7 +690,7 @@ int ImageIO::getTIFFSampleFormat (const Glib::ustring &fname, IIOSampleFormat &s sampleformat = SAMPLEFORMAT_UINT; } - uint16_t config; + std::uint16_t config; TIFFGetField(in, TIFFTAG_PLANARCONFIG, &config); if (config == PLANARCONFIG_CONTIG) { @@ -702,14 +702,14 @@ int ImageIO::getTIFFSampleFormat (const Glib::ustring &fname, IIOSampleFormat &s return IMIO_VARIANTNOTSUPPORTED; } - uint16_t photometric; + std::uint16_t photometric; if (!TIFFGetField(in, TIFFTAG_PHOTOMETRIC, &photometric)) { TIFFClose(in); return IMIO_VARIANTNOTSUPPORTED; } - uint16_t compression; + std::uint16_t compression; if (photometric == PHOTOMETRIC_LOGLUV) if (!TIFFGetField(in, TIFFTAG_COMPRESSION, &compression)) { @@ -787,7 +787,7 @@ int ImageIO::loadTIFF (const Glib::ustring &fname) TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width); TIFFGetField(in, TIFFTAG_IMAGELENGTH, &height); - uint16_t bitspersample, samplesperpixel; + std::uint16_t bitspersample, samplesperpixel; int hasTag = TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bitspersample); hasTag &= TIFFGetField(in, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel); @@ -799,7 +799,7 @@ int ImageIO::loadTIFF (const Glib::ustring &fname) return IMIO_VARIANTNOTSUPPORTED; } - uint16_t config; + std::uint16_t config; TIFFGetField(in, TIFFTAG_PLANARCONFIG, &config); if (config != PLANARCONFIG_CONTIG) { @@ -820,7 +820,7 @@ int ImageIO::loadTIFF (const Glib::ustring &fname) */ if (settings->verbose) { printf("Information of \"%s\":\n", fname.c_str()); - uint16_t tiffDefaultScale, tiffBaselineExposure, tiffLinearResponseLimit; + std::uint16_t tiffDefaultScale, tiffBaselineExposure, tiffLinearResponseLimit; if (TIFFGetField(in, TIFFTAG_DEFAULTSCALE, &tiffDefaultScale)) { printf(" DefaultScale: %d\n", tiffDefaultScale); } @@ -837,7 +837,7 @@ int ImageIO::loadTIFF (const Glib::ustring &fname) else printf(" No LinearResponseLimit value!\n"); - uint16_t tiffMinValue, tiffMaxValue; + std::uint16_t tiffMinValue, tiffMaxValue; if (TIFFGetField(in, TIFFTAG_SMINSAMPLEVALUE, &tiffMinValue)) { printf(" MinValue: %d\n", tiffMinValue); } @@ -1557,15 +1557,15 @@ int ImageIO::saveTIFF (const Glib::ustring &fname, int bps, bool isFloat, bool u */ if (applyExifPatch) { unsigned char b[10]; - uint16_t tagCount = 0; + std::uint16_t tagCount = 0; lseek(fileno, 4, SEEK_SET); read(fileno, b, 4); - uint32_t ifd0Offset = rtexif::sget4(b, exifRoot->getOrder()); + std::uint32_t ifd0Offset = rtexif::sget4(b, exifRoot->getOrder()); lseek(fileno, ifd0Offset, SEEK_SET); read(fileno, b, 2); tagCount = rtexif::sget2(b, exifRoot->getOrder()); for (size_t i = 0; i < tagCount ; ++i) { - uint16_t tagID = 0; + std::uint16_t tagID = 0; read(fileno, b, 2); tagID = rtexif::sget2(b, exifRoot->getOrder()); if (tagID == 0x8769) { From a2394e08cef9fa1b766c3c255c6a07c2080fdff8 Mon Sep 17 00:00:00 2001 From: Lawrence Lee <45837045+Lawrence37@users.noreply.github.com> Date: Sun, 11 Sep 2022 15:10:04 -0700 Subject: [PATCH 4/4] Replace deprecated function (#6563) --- rtgui/rtscalable.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtgui/rtscalable.cc b/rtgui/rtscalable.cc index 78202326a..fda143c4d 100644 --- a/rtgui/rtscalable.cc +++ b/rtgui/rtscalable.cc @@ -241,7 +241,7 @@ Cairo::RefPtr RTScalable::loadImage(const Glib::ustring &fn c->set_operator (Cairo::OPERATOR_OVER); c->scale(r, r); rsvg_handle_render_cairo(handle, c->cobj()); - rsvg_handle_free(handle); + g_object_unref(handle); // -------------------- Saving the image in cache --------------------