@@ -376,7 +376,7 @@ get_link_name (const char *name, int count, int max_length)
376
376
{
377
377
const char * format ;
378
378
char * result ;
379
- int unshortened_length ;
379
+ size_t unshortened_length ;
380
380
gboolean use_count ;
381
381
382
382
g_assert (name != NULL );
@@ -444,10 +444,10 @@ get_link_name (const char *name, int count, int max_length)
444
444
else
445
445
result = g_strdup_printf (format , name );
446
446
447
- if (max_length > 0 && (unshortened_length = strlen (result )) > max_length ) {
447
+ if (max_length > 0 && (unshortened_length = strlen (result )) > ( size_t ) max_length ) {
448
448
char * new_name ;
449
449
450
- new_name = shorten_utf8_string (name , unshortened_length - max_length );
450
+ new_name = shorten_utf8_string (name , (( int ) unshortened_length ) - max_length );
451
451
if (new_name ) {
452
452
g_free (result );
453
453
@@ -456,7 +456,7 @@ get_link_name (const char *name, int count, int max_length)
456
456
else
457
457
result = g_strdup_printf (format , new_name );
458
458
459
- g_assert (strlen (result ) <= max_length );
459
+ g_assert (strlen (result ) <= ( size_t ) max_length );
460
460
g_free (new_name );
461
461
}
462
462
}
@@ -655,7 +655,7 @@ make_next_duplicate_name (const char *base, const char *suffix, int count, int m
655
655
{
656
656
const char * format ;
657
657
char * result ;
658
- int unshortened_length ;
658
+ size_t unshortened_length ;
659
659
gboolean use_count ;
660
660
661
661
if (count < 1 ) {
@@ -733,10 +733,10 @@ make_next_duplicate_name (const char *base, const char *suffix, int count, int m
733
733
else
734
734
result = g_strdup_printf (format , base , suffix );
735
735
736
- if (max_length > 0 && (unshortened_length = strlen (result )) > max_length ) {
736
+ if (max_length > 0 && (unshortened_length = strlen (result )) > ( size_t ) max_length ) {
737
737
char * new_base ;
738
738
739
- new_base = shorten_utf8_string (base , unshortened_length - max_length );
739
+ new_base = shorten_utf8_string (base , (( int ) unshortened_length ) - max_length );
740
740
if (new_base ) {
741
741
g_free (result );
742
742
@@ -745,7 +745,7 @@ make_next_duplicate_name (const char *base, const char *suffix, int count, int m
745
745
else
746
746
result = g_strdup_printf (format , new_base , suffix );
747
747
748
- g_assert (strlen (result ) <= max_length );
748
+ g_assert (strlen (result ) <= ( size_t ) max_length );
749
749
g_free (new_base );
750
750
}
751
751
}
@@ -1778,7 +1778,7 @@ delete_file (CommonJob *job, GFile *file,
1778
1778
}
1779
1779
1780
1780
static void
1781
- delete_files (CommonJob * job , GList * files , int * files_skipped )
1781
+ delete_files (CommonJob * job , GList * files , guint * files_skipped )
1782
1782
{
1783
1783
GList * l ;
1784
1784
SourceInfo source_info ;
@@ -1821,10 +1821,10 @@ delete_files (CommonJob *job, GList *files, int *files_skipped)
1821
1821
1822
1822
static void
1823
1823
report_trash_progress (CommonJob * job ,
1824
- int files_trashed ,
1825
- int total_files )
1824
+ guint files_trashed ,
1825
+ guint total_files )
1826
1826
{
1827
- int files_left ;
1827
+ guint files_left ;
1828
1828
char * s ;
1829
1829
1830
1830
files_left = total_files - files_trashed ;
@@ -1844,13 +1844,13 @@ report_trash_progress (CommonJob *job,
1844
1844
}
1845
1845
1846
1846
static void
1847
- trash_files (CommonJob * job , GList * files , int * files_skipped )
1847
+ trash_files (CommonJob * job , GList * files , guint * files_skipped )
1848
1848
{
1849
1849
GList * l ;
1850
1850
GFile * file ;
1851
1851
GList * to_delete ;
1852
1852
GError * error ;
1853
- int total_files , files_trashed ;
1853
+ guint total_files , files_trashed ;
1854
1854
char * primary , * secondary , * details ;
1855
1855
int response ;
1856
1856
@@ -1978,7 +1978,7 @@ delete_job (GIOSchedulerJob *io_job,
1978
1978
gboolean must_confirm_delete_in_trash ;
1979
1979
gboolean must_confirm_delete ;
1980
1980
gboolean must_confirm_trash ;
1981
- int files_skipped ;
1981
+ guint files_skipped ;
1982
1982
GFile * file = NULL ;
1983
1983
1984
1984
common = (CommonJob * )job ;
@@ -2923,11 +2923,11 @@ verify_destination (CommonJob *job,
2923
2923
free_size = g_file_info_get_attribute_uint64 (fsinfo ,
2924
2924
G_FILE_ATTRIBUTE_FILESYSTEM_FREE );
2925
2925
2926
- if (free_size < required_size ) {
2926
+ if (free_size < ( guint64 ) required_size ) {
2927
2927
primary = f (_ ("Error while copying to \"%B\"." ), dest );
2928
2928
secondary = f (_ ("There is not enough space on the destination. Try to remove files to make space." ));
2929
2929
2930
- details = f (_ ("There is %S available, but %S is required." ), free_size , required_size );
2930
+ details = f (_ ("There is %" G_GUINT64_FORMAT " available, but %" G_GOFFSET_FORMAT " is required." ), free_size , required_size );
2931
2931
2932
2932
response = run_warning (job ,
2933
2933
primary ,
@@ -3174,7 +3174,7 @@ make_file_name_valid_for_dest_fs (char *filename,
3174
3174
!strcmp (dest_fs_type , "msdos" ) ||
3175
3175
!strcmp (dest_fs_type , "msdosfs" )) {
3176
3176
gboolean ret ;
3177
- int i , old_len ;
3177
+ size_t i , old_len ;
3178
3178
3179
3179
ret = str_replace (filename , FAT_FORBIDDEN_CHARACTERS , '_' );
3180
3180
@@ -6134,11 +6134,13 @@ create_job (GIOSchedulerJob *io_job,
6134
6134
if (count == 1 ) {
6135
6135
new_filename = g_strdup (filename );
6136
6136
} else if (job -> make_dir ) {
6137
- filename2 = g_strdup_printf ( "%s %d" , filename , count ) ;
6137
+ size_t unshortened_length ;
6138
6138
6139
+ filename2 = g_strdup_printf ("%s %d" , filename , count );
6140
+ unshortened_length = strlen (filename2 );
6139
6141
new_filename = NULL ;
6140
- if (max_length > 0 && strlen ( filename2 ) > max_length ) {
6141
- new_filename = shorten_utf8_string (filename2 , strlen ( filename2 ) - max_length );
6142
+ if (max_length > 0 && unshortened_length > ( size_t ) max_length ) {
6143
+ new_filename = shorten_utf8_string (filename2 , (( int ) unshortened_length ) - max_length );
6142
6144
}
6143
6145
6144
6146
if (new_filename == NULL ) {
0 commit comments