diff --git a/.clang_complete b/.clang_complete index f8793316..f4990021 100644 --- a/.clang_complete +++ b/.clang_complete @@ -13,6 +13,7 @@ -fPIC -g -D_GNU_SOURCE +-DHAVE_STAT64=0 -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/gtk-3.0 diff --git a/lib/file.c b/lib/file.c index 51c916ed..2af97e75 100644 --- a/lib/file.c +++ b/lib/file.c @@ -84,7 +84,7 @@ RmFile *rm_file_new(struct RmSession *session, const char *path, self->is_original = false; self->is_symlink = false; self->path_index = path_index; - self->outter_link_count = -1; + self->outer_link_count = -1; return self; } diff --git a/lib/file.h b/lib/file.h index b0d765c9..c68d8de9 100644 --- a/lib/file.h +++ b/lib/file.h @@ -117,13 +117,14 @@ typedef struct RmFile { gint16 depth; /* Link count (number of hardlinks + 1) of the file as told by stat() + * This is used for the 'hH'-sortcriteria. */ gint16 link_count; /* Hardlinks to this file *outside* of the paths that rmlint traversed. - * This is used for the outlyer sortcriteria (O). + * This is used for the 'oO'-sortcriteria. * */ - gint16 outter_link_count; + gint16 outer_link_count; /* Depth of the path of this file. */ diff --git a/lib/preprocess.c b/lib/preprocess.c index ae8b5d9a..4f259395 100644 --- a/lib/preprocess.c +++ b/lib/preprocess.c @@ -376,10 +376,10 @@ int rm_pp_cmp_orig_criteria(const RmFile *a, const RmFile *b, const RmSession *s RmCfg *sets = session->cfg; for(int i = 0, regex_cursor = 0; sets->sort_criteria[i]; i++) { - long cmp = 0; + gint64 cmp = 0; switch(tolower((unsigned char)sets->sort_criteria[i])) { case 'm': - cmp = (long)(a->mtime) - (long)(b->mtime); + cmp = (gint64)(a->mtime) - (gint64)(b->mtime); break; case 'a': cmp = g_ascii_strcasecmp(a->folder->basename, b->folder->basename); @@ -388,16 +388,16 @@ int rm_pp_cmp_orig_criteria(const RmFile *a, const RmFile *b, const RmSession *s cmp = strlen(a->folder->basename) - strlen(b->folder->basename); break; case 'd': - cmp = (short)a->depth - (short)b->depth; + cmp = (gint64)a->depth - (gint64)b->depth; break; case 'h': - cmp = (long)a->link_count - (long)b->link_count; + cmp = (gint64)a->link_count - (gint64)b->link_count; break; case 'o': - cmp = (guint64)a->outter_link_count - (guint64)b->outter_link_count; + cmp = (gint64)a->outer_link_count - (gint64)b->outer_link_count; break; case 'p': - cmp = (long)a->path_index - (long)b->path_index; + cmp = (gint64)a->path_index - (gint64)b->path_index; break; case 'x': { cmp = rm_pp_cmp_by_regex( diff --git a/lib/shredder.c b/lib/shredder.c index 0136b669..3a12ff9c 100644 --- a/lib/shredder.c +++ b/lib/shredder.c @@ -1210,18 +1210,18 @@ void rm_shred_group_find_original(RmSession *session, GQueue *files, RmShredGrou * unbundle the cluster and append it to the queue */ GQueue *hardlinks = file->hardlinks.files; - file->outter_link_count = file->link_count - (hardlinks->length + 1); + file->outer_link_count = file->link_count - (hardlinks->length + 1); for(GList *link = hardlinks->head; link; link = link->next) { RmFile *bundled_file = link->data; - bundled_file->outter_link_count = file->outter_link_count; + bundled_file->outer_link_count = file->outer_link_count; g_queue_push_tail(files, bundled_file); } g_queue_free(hardlinks); file->hardlinks.files = NULL; - } else if(file->outter_link_count < 0) { - file->outter_link_count = file->link_count - 1; + } else if(file->outer_link_count < 0) { + file->outer_link_count = file->link_count - 1; } if (status == RM_SHRED_GROUP_FINISHING) {