summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-11-12 12:17:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-02-11 08:24:19 +0100
commitf76bf262a60c154684ffefbd53a5339fa3864e42 (patch)
tree6b287051d4ad9d5258eecd3efa0ebb8a020d2b2c /solenv
parentb143e7642f93e83f4f3c4df56c3e1e8e64e36ce0 (diff)
new loplugin indentation
look for mixed indentation in compound statements, which makes them hard to read, and sometimes makes it look like a statement is associated with a nearby if/for Change-Id: Ic8429cee1f9a86d938097a4a8769a2bce97b3361 Reviewed-on: https://gerrit.libreoffice.org/63283 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'solenv')
-rw-r--r--solenv/CompilerTest_compilerplugins_clang.mk1
-rw-r--r--solenv/bin/concat-deps.c96
-rw-r--r--solenv/clang-format/blacklist1
3 files changed, 50 insertions, 48 deletions
diff --git a/solenv/CompilerTest_compilerplugins_clang.mk b/solenv/CompilerTest_compilerplugins_clang.mk
index d5dcd1796545..a83cf703793f 100644
--- a/solenv/CompilerTest_compilerplugins_clang.mk
+++ b/solenv/CompilerTest_compilerplugins_clang.mk
@@ -32,6 +32,7 @@ $(eval $(call gb_CompilerTest_add_exception_objects,compilerplugins_clang, \
compilerplugins/clang/test/faileddyncast \
compilerplugins/clang/test/finalprotected \
compilerplugins/clang/test/flatten \
+ compilerplugins/clang/test/indentation \
compilerplugins/clang/test/loopvartoosmall \
compilerplugins/clang/test/oncevar \
compilerplugins/clang/test/oslendian-1 \
diff --git a/solenv/bin/concat-deps.c b/solenv/bin/concat-deps.c
index 9981b7775ee0..b3182e49feae 100644
--- a/solenv/bin/concat-deps.c
+++ b/solenv/bin/concat-deps.c
@@ -143,7 +143,7 @@ int result = 32;
static unsigned int get_unaligned_uint(const unsigned char* cursor)
{
-unsigned int result;
+ unsigned int result;
memcpy(&result, cursor, sizeof(unsigned int));
return result;
@@ -168,9 +168,9 @@ struct pool
static void* pool_take_extent(struct pool* pool, int allocate)
{
-unsigned int size = 0;
-void* extent;
-void* data = NULL;
+ unsigned int size = 0;
+ void* extent;
+ void* data = NULL;
if(pool->extent)
{
@@ -214,7 +214,7 @@ void* data = NULL;
*/
static struct pool* pool_create(int size_elem, int primary, int secondary)
{
-struct pool* pool;
+ struct pool* pool;
assert(primary > 0);
assert(secondary >= 0);
@@ -237,8 +237,8 @@ struct pool* pool;
static void pool_destroy(struct pool* pool)
{
-void* extent;
-void* next;
+ void* extent;
+ void* next;
if(pool != NULL)
{
@@ -255,7 +255,7 @@ void* next;
static void* pool_alloc(struct pool* pool)
{
-void* data;
+ void* data;
data = pool->head_free;
if(data == NULL)
@@ -442,7 +442,7 @@ static void hash_destroy(struct hash* hash)
static struct hash* hash_create(unsigned int size)
{
-struct hash* hash;
+ struct hash* hash;
assert(size > 0);
hash = calloc(1, sizeof(struct hash));
@@ -481,12 +481,12 @@ struct hash* hash;
static void hash_resize(struct hash* hash)
{
-unsigned int old_size = hash->size;
-unsigned int hashed;
-struct hash_elem* hash_elem;
-struct hash_elem* next;
-struct hash_elem** array;
-unsigned int i;
+ unsigned int old_size = hash->size;
+ unsigned int hashed;
+ struct hash_elem* hash_elem;
+ struct hash_elem* next;
+ struct hash_elem** array;
+ unsigned int i;
hash->size = (old_size << 1) + 1;
/* we really should avoid to get there... so print a message to alert of the condition */
@@ -538,9 +538,9 @@ static int compare_key(struct hash const * hash, const char* a, const char* b, i
*/
static int hash_store(struct hash* hash, const char* key, int key_len)
{
-unsigned int hashed;
-struct hash_elem* hash_elem;
-int cost = 0;
+ unsigned int hashed;
+ struct hash_elem* hash_elem;
+ int cost = 0;
(void) cost;
hashed = hash_compute(hash, key, key_len);
@@ -583,7 +583,7 @@ int cost = 0;
static int file_stat(const char* name, struct stat* buffer_stat, int* rc)
{
-int rc_local = 0;
+ int rc_local = 0;
rc_local = stat(name, buffer_stat);
if (rc_local < 0)
@@ -595,8 +595,8 @@ int rc_local = 0;
static off_t file_get_size(const char* name, int* rc)
{
-struct stat buffer_stat;
-off_t size = -1;
+ struct stat buffer_stat;
+ off_t size = -1;
if (!file_stat(name, &buffer_stat, rc))
{
@@ -619,10 +619,10 @@ static size_t file_load_buffer_count = 0;
static char* file_load(const char* name, off_t* size, int* return_rc)
{
-off_t local_size = 0;
-int rc = 0;
-char* buffer = NULL;
-int fd;
+ off_t local_size = 0;
+ int rc = 0;
+ char* buffer = NULL;
+ int fd;
assert(name != NULL);
@@ -657,7 +657,7 @@ int fd;
}
else
{
- ssize_t i;
+ ssize_t i;
REDO:
i = read(fd, buffer, (size_t)(*size));
@@ -873,9 +873,9 @@ static char * eat_space_at_end(char * end)
static char* phony_content_buffer;
static char* generate_phony_line(char const * phony_target, char const * extension)
{
-char const * src;
-char* dest;
-char* last_dot = NULL;
+ char const * src;
+ char* dest;
+ char* last_dot = NULL;
//fprintf(stderr, "generate_phony_line called with phony_target %s and extension %s\n", phony_target, extension);
for(dest = phony_content_buffer+work_dir_len+1, src = phony_target; *src != 0; ++src, ++dest)
{
@@ -898,7 +898,7 @@ char* last_dot = NULL;
static int generate_phony_file(char* fn, char const * content)
{
-FILE* depfile;
+ FILE* depfile;
depfile = fopen(fn, "w");
if(!depfile)
{
@@ -914,17 +914,17 @@ FILE* depfile;
static int process(struct hash* dep_hash, char* fn)
{
-int rc;
-char* buffer;
-char* end;
-char* cursor;
-char* cursor_out;
-char* base;
-char* created_line = NULL;
-char* src_relative;
-int continuation = 0;
-char last_ns = 0;
-off_t size;
+ int rc;
+ char* buffer;
+ char* end;
+ char* cursor;
+ char* cursor_out;
+ char* base;
+ char* created_line = NULL;
+ char* src_relative;
+ int continuation = 0;
+ char last_ns = 0;
+ off_t size;
buffer = file_load(fn, &size, &rc);
if(!rc)
@@ -1129,13 +1129,13 @@ static int get_var(char **var, const char *name)
int main(int argc, char** argv)
{
-int rc = 0;
-off_t in_list_size = 0;
-char* in_list;
-char* in_list_cursor;
-char* in_list_base;
-struct hash* dep_hash = NULL;
-const char *env_str;
+ int rc = 0;
+ off_t in_list_size = 0;
+ char* in_list;
+ char* in_list_cursor;
+ char* in_list_base;
+ struct hash* dep_hash = NULL;
+ const char *env_str;
if(argc < 2)
{
diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist
index c7d477027848..3d48948e1734 100644
--- a/solenv/clang-format/blacklist
+++ b/solenv/clang-format/blacklist
@@ -1824,6 +1824,7 @@ compilerplugins/clang/test/externvar.hxx
compilerplugins/clang/test/faileddyncast.cxx
compilerplugins/clang/test/finalprotected.cxx
compilerplugins/clang/test/flatten.cxx
+compilerplugins/clang/test/indentation.cxx
compilerplugins/clang/test/loopvartoosmall.cxx
compilerplugins/clang/test/oncevar.cxx
compilerplugins/clang/test/oslendian-1.cxx