summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlhchavez <lhchavez@lhchavez.com>2021-11-14 02:24:39 -0800
committerlhchavez <lhchavez@lhchavez.com>2021-11-14 02:24:39 -0800
commit0c4d24dad2db95132568043bb086dff2af400eda (patch)
tree6674570c8a7e5f3ffd5441004ef829d6bd983dac
parent043f3123e3c63b634d9bfd7276e70d86b8accadc (diff)
downloadlibgit2-0c4d24dad2db95132568043bb086dff2af400eda.tar.gz
Fix a gcc 11 warning in src/threadstate.c
When building under gcc 11, there is a warning about a misaligned guard clause because there were mixed spaces and tabs: ``` [128/634] Building C object src/CMakeFiles/git2internal.dir/threadstate.c.o ../src/threadstate.c: In function ‘threadstate_dispose’: ../src/threadstate.c:39:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 39 | if (threadstate->error_t.message != git_str__initstr) | ^~ ../src/threadstate.c:41:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 41 | threadstate->error_t.message = NULL; | ^~~~~~~~~~~ ../src/threadstate.c: At top level: ``` This change indents the code with tabs for consistency with the rest of the code, which makes the warning go away.
-rw-r--r--src/threadstate.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/threadstate.c b/src/threadstate.c
index f67cf082b..9e3ef5818 100644
--- a/src/threadstate.c
+++ b/src/threadstate.c
@@ -36,8 +36,8 @@ static void threadstate_dispose(git_threadstate *threadstate)
if (!threadstate)
return;
- if (threadstate->error_t.message != git_str__initstr)
- git__free(threadstate->error_t.message);
+ if (threadstate->error_t.message != git_str__initstr)
+ git__free(threadstate->error_t.message);
threadstate->error_t.message = NULL;
}