@@ -38,11 +38,11 @@ void MultiImageWriteThread::addImage(const QString &folder, const QString &flavo
3838void MultiImageWriteThread::run ()
3939{
4040 /* Calculate space requirements, and check special requirements */
41- int totalnominalsize = 0 , totaluncompressedsize = 0 , numparts = 0 , numexpandparts = 0 ;
42- int startSector = getFileContents (sysclassblock (_drive, 5 )+" /start" ).trimmed ().toULongLong ()
43- + getFileContents (sysclassblock (_drive, 5 )+" /size" ).trimmed ().toULongLong ();
44- int totalSectors = getFileContents (sysclassblock (_drive)+" /size" ).trimmed ().toULongLong ();
45- int availableMB = (totalSectors-startSector)/2048 ;
41+ uint totalnominalsize = 0 , totaluncompressedsize = 0 , numparts = 0 , numexpandparts = 0 ;
42+ uint startSector = getFileContents (sysclassblock (_drive, 5 )+" /start" ).trimmed ().toUInt ()
43+ + getFileContents (sysclassblock (_drive, 5 )+" /size" ).trimmed ().toUInt ();
44+ uint totalSectors = getFileContents (sysclassblock (_drive)+" /size" ).trimmed ().toUInt ();
45+ uint availableMB = (totalSectors-startSector)/2048 ;
4646
4747 /* key: partition number, value: partition information */
4848 QMap<int , PartitionInfo *> partitionMap, bootPartitionMap;
@@ -146,7 +146,8 @@ void MultiImageWriteThread::run()
146146 }
147147
148148 /* Assign logical partition numbers to partitions that did not reserve a special number */
149- int pnr, bootpnr, offset = 0 ;
149+ int pnr, bootpnr;
150+ uint offset = 0 ;
150151 if (partitionMap.isEmpty ())
151152 pnr = 6 ;
152153 else
@@ -155,8 +156,8 @@ void MultiImageWriteThread::run()
155156 if (_multiDrives)
156157 {
157158 bootpnr = 6 ;
158- offset = getFileContents (sysclassblock (_bootdrive, 5 )+" /start" ).trimmed ().toULongLong ()
159- + getFileContents (sysclassblock (_bootdrive, 5 )+" /size" ).trimmed ().toULongLong ();
159+ offset = getFileContents (sysclassblock (_bootdrive, 5 )+" /start" ).trimmed ().toUInt ()
160+ + getFileContents (sysclassblock (_bootdrive, 5 )+" /size" ).trimmed ().toUInt ();
160161 }
161162
162163 foreach (OsInfo *image, _images)
@@ -178,7 +179,7 @@ void MultiImageWriteThread::run()
178179 offset += PARTITION_ALIGNMENT-(offset % PARTITION_ALIGNMENT);
179180 }
180181 partition->setOffset (offset);
181- int partsizeSectors = partition->partitionSizeNominal () * 2048 ;
182+ uint partsizeSectors = partition->partitionSizeNominal () * 2048 ;
182183 partition->setPartitionSizeSectors (partsizeSectors);
183184 offset += partsizeSectors;
184185 }
@@ -228,15 +229,15 @@ void MultiImageWriteThread::run()
228229 p->setOffset (offset);
229230 }
230231
231- int partsizeMB = p->partitionSizeNominal ();
232+ uint partsizeMB = p->partitionSizeNominal ();
232233 if ( p->wantMaximised () )
233234 partsizeMB += _extraSpacePerPartition;
234- int partsizeSectors = partsizeMB * 2048 ;
235+ uint partsizeSectors = partsizeMB * 2048 ;
235236
236237 if (p == log_before_prim.last ())
237238 {
238239 /* Let last partition have any remaining space that we couldn't divide evenly */
239- int spaceleft = totalSectors - offset - partsizeSectors;
240+ uint spaceleft = totalSectors - offset - partsizeSectors;
240241
241242 if (spaceleft > 0 && p->wantMaximised ())
242243 {
@@ -326,13 +327,13 @@ bool MultiImageWriteThread::writePartitionTable(const QString &drive, const QMap
326327 /* Write partition table using sfdisk */
327328
328329 /* Fixed NOOBS partition */
329- int startP1 = getFileContents (sysclassblock (drive, 1 )+" /start" ).trimmed ().toInt ();
330- int sizeP1 = getFileContents (sysclassblock (drive, 1 )+" /size" ).trimmed ().toInt ();
330+ uint startP1 = getFileContents (sysclassblock (drive, 1 )+" /start" ).trimmed ().toUInt ();
331+ uint sizeP1 = getFileContents (sysclassblock (drive, 1 )+" /size" ).trimmed ().toUInt ();
331332 /* Fixed start of extended partition. End is not fixed, as it depends on primary partition 3 & 4 */
332333 int startExtended = startP1+sizeP1;
333334 /* Fixed settings partition */
334- int startP5 = getFileContents (sysclassblock (drive, SETTINGS_PARTNR)+" /start" ).trimmed ().toInt ();
335- int sizeP5 = getFileContents (sysclassblock (drive, SETTINGS_PARTNR)+" /size" ).trimmed ().toInt ();
335+ uint startP5 = getFileContents (sysclassblock (drive, SETTINGS_PARTNR)+" /start" ).trimmed ().toUInt ();
336+ uint sizeP5 = getFileContents (sysclassblock (drive, SETTINGS_PARTNR)+" /size" ).trimmed ().toUInt ();
336337
337338 if (!startP1 || !sizeP1 || !startP5 || !sizeP5)
338339 {
@@ -346,7 +347,7 @@ bool MultiImageWriteThread::writePartitionTable(const QString &drive, const QMap
346347 partitionMap.insert (1 , new PartitionInfo (1 , startP1, sizeP1, " 0E" , this )); /* FAT boot partition */
347348 partitionMap.insert (5 , new PartitionInfo (5 , startP5, sizeP5, " L" , this )); /* Ext4 settings partition */
348349
349- int sizeExtended = partitionMap.values ().last ()->endSector () - startExtended;
350+ uint sizeExtended = partitionMap.values ().last ()->endSector () - startExtended;
350351 if (!partitionMap.contains (2 ))
351352 {
352353 partitionMap.insert (2 , new PartitionInfo (2 , startExtended, sizeExtended, " E" , this ));
0 commit comments