summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2021-06-25 14:14:26 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2021-06-25 15:12:41 +0200
commitd4690eeabe557753b394b8f83b5dbaf83e57e15f (patch)
tree718a8342f450bc74b746d64d873ec3644419da73
parent8348086b48af0cbabe4cf2b64992ced6561ea50c (diff)
Add default cases for every switch block
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r--bin/rdsquashfs/describe.c2
-rw-r--r--bin/rdsquashfs/list_files.c2
-rw-r--r--bin/rdsquashfs/rdsquashfs.c2
-rw-r--r--bin/rdsquashfs/stat.c4
-rw-r--r--bin/sqfsdiff/node_compare.c2
-rw-r--r--extras/browse.c4
-rw-r--r--lib/common/comp_opt.c2
-rw-r--r--lib/common/inode_stat.c2
-rw-r--r--lib/sqfs/comp/gzip.c2
-rw-r--r--lib/sqfs/comp/xz.c2
-rw-r--r--lib/sqfs/dir_writer.c2
-rw-r--r--lib/sqfs/read_tree.c2
-rw-r--r--lib/sqfs/write_inode.c2
-rw-r--r--lib/tar/read_header.c2
14 files changed, 32 insertions, 0 deletions
diff --git a/bin/rdsquashfs/describe.c b/bin/rdsquashfs/describe.c
index 8f45243..5107f95 100644
--- a/bin/rdsquashfs/describe.c
+++ b/bin/rdsquashfs/describe.c
@@ -128,6 +128,8 @@ int describe_tree(const sqfs_tree_node_t *root, const char *unpack_root)
return -1;
}
break;
+ default:
+ break;
}
return 0;
diff --git a/bin/rdsquashfs/list_files.c b/bin/rdsquashfs/list_files.c
index 238ffec..b1a0102 100644
--- a/bin/rdsquashfs/list_files.c
+++ b/bin/rdsquashfs/list_files.c
@@ -37,6 +37,7 @@ static void mode_to_str(sqfs_u16 mode, char *p)
case S_IXGRP: *(p++) = 'x'; break;
case S_ISGID: *(p++) = 'S'; break;
case 0: *(p++) = '-'; break;
+ default: break;
}
*(p++) = (mode & S_IROTH) ? 'r' : '-';
@@ -47,6 +48,7 @@ static void mode_to_str(sqfs_u16 mode, char *p)
case S_IXOTH: *(p++) = 'x'; break;
case S_ISVTX: *(p++) = 'T'; break;
case 0: *(p++) = '-'; break;
+ default: break;
}
*p = '\0';
diff --git a/bin/rdsquashfs/rdsquashfs.c b/bin/rdsquashfs/rdsquashfs.c
index 5b6ce19..47eaf94 100644
--- a/bin/rdsquashfs/rdsquashfs.c
+++ b/bin/rdsquashfs/rdsquashfs.c
@@ -165,6 +165,8 @@ int main(int argc, char **argv)
if (dump_xattrs(xattr, n->inode))
goto out;
break;
+ default:
+ break;
}
status = EXIT_SUCCESS;
diff --git a/bin/rdsquashfs/stat.c b/bin/rdsquashfs/stat.c
index a5aab60..642aae9 100644
--- a/bin/rdsquashfs/stat.c
+++ b/bin/rdsquashfs/stat.c
@@ -87,6 +87,8 @@ int stat_file(const sqfs_tree_node_t *node)
case SQFS_INODE_EXT_SOCKET:
nlinks = inode->data.ipc_ext.nlink;
break;
+ default:
+ break;
}
timeval = inode->base.mod_time;
@@ -175,6 +177,8 @@ int stat_file(const sqfs_tree_node_t *node)
sqfs_free(idx);
}
break;
+ default:
+ break;
}
return 0;
}
diff --git a/bin/sqfsdiff/node_compare.c b/bin/sqfsdiff/node_compare.c
index 59d1831..d8f0878 100644
--- a/bin/sqfsdiff/node_compare.c
+++ b/bin/sqfsdiff/node_compare.c
@@ -78,6 +78,8 @@ int node_compare(sqfsdiff_t *sd, sqfs_tree_node_t *a, sqfs_tree_node_t *b)
if (b->inode->base.type == SQFS_INODE_SOCKET)
demoted = true;
break;
+ default:
+ break;
}
if (promoted) {
diff --git a/extras/browse.c b/extras/browse.c
index 8b96c15..d78ac5a 100644
--- a/extras/browse.c
+++ b/extras/browse.c
@@ -142,6 +142,8 @@ static void list_directory(const char *dirname)
case SQFS_INODE_SOCKET:
fputs("\033[01;35m", stdout);
break;
+ default:
+ break;
}
len = ent->size + 1;
@@ -401,6 +403,8 @@ static void stat_cmd(const char *filename)
sqfs_free(idx);
}
break;
+ default:
+ break;
}
sqfs_free(inode);
diff --git a/lib/common/comp_opt.c b/lib/common/comp_opt.c
index a0d4cf7..d605c0c 100644
--- a/lib/common/comp_opt.c
+++ b/lib/common/comp_opt.c
@@ -212,6 +212,8 @@ int compressor_cfg_init_options(sqfs_compressor_config_t *cfg,
case OPT_PB: cfg->opt.xz.pb = ival; break;
case OPT_WINDOW: cfg->opt.gzip.window_size = ival; break;
case OPT_DICT: cfg->opt.xz.dict_size = ival; break;
+ default:
+ break;
}
}
diff --git a/lib/common/inode_stat.c b/lib/common/inode_stat.c
index a73436b..fd0668a 100644
--- a/lib/common/inode_stat.c
+++ b/lib/common/inode_stat.c
@@ -66,6 +66,8 @@ int inode_stat(const sqfs_tree_node_t *node, struct stat *sb)
sb->st_size = node->inode->data.dir_ext.size;
sb->st_nlink = node->inode->data.dir_ext.nlink;
break;
+ default:
+ break;
}
sb->st_blocks = sb->st_size / sb->st_blksize;
diff --git a/lib/sqfs/comp/gzip.c b/lib/sqfs/comp/gzip.c
index 91cd87e..39d4227 100644
--- a/lib/sqfs/comp/gzip.c
+++ b/lib/sqfs/comp/gzip.c
@@ -117,6 +117,8 @@ static int flag_to_zlib_strategy(int flag)
return Z_RLE;
case SQFS_COMP_FLAG_GZIP_FIXED:
return Z_FIXED;
+ default:
+ break;
}
return 0;
diff --git a/lib/sqfs/comp/xz.c b/lib/sqfs/comp/xz.c
index 7d7991d..3fb27b2 100644
--- a/lib/sqfs/comp/xz.c
+++ b/lib/sqfs/comp/xz.c
@@ -144,6 +144,8 @@ static lzma_vli flag_to_vli(int flag)
return LZMA_FILTER_ARMTHUMB;
case SQFS_COMP_FLAG_XZ_SPARC:
return LZMA_FILTER_SPARC;
+ default:
+ break;
}
return LZMA_VLI_UNKNOWN;
diff --git a/lib/sqfs/dir_writer.c b/lib/sqfs/dir_writer.c
index e425b41..908bb01 100644
--- a/lib/sqfs/dir_writer.c
+++ b/lib/sqfs/dir_writer.c
@@ -64,6 +64,8 @@ static int get_type(sqfs_u16 mode)
case S_IFCHR: return SQFS_INODE_CDEV;
case S_IFDIR: return SQFS_INODE_DIR;
case S_IFREG: return SQFS_INODE_FILE;
+ default:
+ break;
}
return SQFS_ERROR_UNSUPPORTED;
diff --git a/lib/sqfs/read_tree.c b/lib/sqfs/read_tree.c
index 56b4f0c..802446a 100644
--- a/lib/sqfs/read_tree.c
+++ b/lib/sqfs/read_tree.c
@@ -37,6 +37,8 @@ static int should_skip(int type, unsigned int flags)
case SQFS_INODE_FIFO:
case SQFS_INODE_EXT_FIFO:
return (flags & SQFS_TREE_NO_FIFO);
+ default:
+ break;
}
return 0;
diff --git a/lib/sqfs/write_inode.c b/lib/sqfs/write_inode.c
index 8d8fa7a..118b713 100644
--- a/lib/sqfs/write_inode.c
+++ b/lib/sqfs/write_inode.c
@@ -212,6 +212,8 @@ int sqfs_meta_writer_write_inode(sqfs_meta_writer_t *ir,
};
return sqfs_meta_writer_append(ir, &ipc, sizeof(ipc));
}
+ default:
+ break;
}
return SQFS_ERROR_UNSUPPORTED;
diff --git a/lib/tar/read_header.c b/lib/tar/read_header.c
index b332514..ecba0bc 100644
--- a/lib/tar/read_header.c
+++ b/lib/tar/read_header.c
@@ -252,6 +252,8 @@ int read_header(istream_t *fp, tar_header_decoded_t *out)
&out->actual_size))
goto fail;
break;
+ default:
+ break;
}
break;
}