gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnurl] 124/178: checksrc: force indentation of lines after


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 124/178: checksrc: force indentation of lines after an else
Date: Wed, 23 May 2018 12:25:59 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository gnurl.

commit 2f13e3d23d9acd448b1e1e2cad419b4c118c43e4
Author: Daniel Gustafsson <address@hidden>
AuthorDate: Wed Apr 25 21:53:27 2018 +0200

    checksrc: force indentation of lines after an else
    
    This extends the INDENTATION case to also handle 'else' statements
    and require proper indentation on the following line. Also fixes the
    offending cases found in the codebase.
    
    Closes #2532
---
 lib/checksrc.pl             | 8 ++++----
 lib/multi.c                 | 3 +--
 lib/rtsp.c                  | 3 +--
 lib/telnet.c                | 3 +--
 lib/vtls/schannel.c         | 3 +--
 src/tool_operate.c          | 6 ++----
 tests/libtest/stub_gssapi.c | 2 +-
 7 files changed, 11 insertions(+), 17 deletions(-)

diff --git a/lib/checksrc.pl b/lib/checksrc.pl
index 1a695ba2c..c90e245ee 100755
--- a/lib/checksrc.pl
+++ b/lib/checksrc.pl
@@ -499,9 +499,9 @@ sub scanfile {
         }
 
         # if the previous line starts with if/while/for AND ends with an open
-        # brace, check that this line is indented $indent more steps, if not
-        # a cpp line
-        if($prevl =~ /^( *)(if|while|for)\(.*\{\z/) {
+        # brace, or an else statement, check that this line is indented $indent
+        # more steps, if not a cpp line
+        if($prevl =~ /^( *)((if|while|for)\(.*\{|else)\z/) {
             my $first = length($1);
 
             # this line has some character besides spaces
@@ -511,7 +511,7 @@ sub scanfile {
                 if($expect != $second) {
                     my $diff = $second - $first;
                     checkwarn("INDENTATION", $line, length($1), $file, $ol,
-                              "not indented $indent steps, uses $diff)");
+                              "not indented $indent steps (uses $diff)");
 
                 }
             }
diff --git a/lib/multi.c b/lib/multi.c
index 5f32dd2a1..f85284695 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -1798,8 +1798,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
       if((data->easy_conn->sockfd != CURL_SOCKET_BAD) ||
          (data->easy_conn->writesockfd != CURL_SOCKET_BAD))
         multistate(data, CURLM_STATE_WAITPERFORM);
-      else
-      {
+      else {
         if(data->state.wildcardmatch &&
            ((data->easy_conn->handler->flags & PROTOPT_WILDCARD) == 0)) {
            data->wildcard.state = CURLWC_DONE;
diff --git a/lib/rtsp.c b/lib/rtsp.c
index 194bc949e..41f300013 100644
--- a/lib/rtsp.c
+++ b/lib/rtsp.c
@@ -764,8 +764,7 @@ CURLcode rtp_client_write(struct connectdata *conn, char 
*ptr, size_t len)
     writeit = data->set.fwrite_rtp;
     user_ptr = data->set.rtp_out;
   }
-  else
-  {
+  else {
     writeit = data->set.fwrite_func;
     user_ptr = data->set.out;
   }
diff --git a/lib/telnet.c b/lib/telnet.c
index 78d3a853d..d71c8e067 100644
--- a/lib/telnet.c
+++ b/lib/telnet.c
@@ -1203,8 +1203,7 @@ CURLcode telrcv(struct connectdata *conn,
           CURL_SB_ACCUM(tn, c);
           tn->telrcv_state = CURL_TS_SB;
         }
-        else
-        {
+        else {
           CURL_SB_ACCUM(tn, CURL_IAC);
           CURL_SB_ACCUM(tn, CURL_SE);
           tn->subpointer -= 2;
diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c
index 190ecca23..01f6f6691 100644
--- a/lib/vtls/schannel.c
+++ b/lib/vtls/schannel.c
@@ -544,8 +544,7 @@ schannel_connect_step1(struct connectdata *conn, int 
sockindex)
     InitSecBuffer(&inbuf, SECBUFFER_APPLICATION_PROTOCOLS, alpn_buffer, cur);
     InitSecBufferDesc(&inbuf_desc, &inbuf, 1);
   }
-  else
-  {
+  else {
     InitSecBuffer(&inbuf, SECBUFFER_EMPTY, NULL, 0);
     InitSecBufferDesc(&inbuf_desc, &inbuf, 1);
   }
diff --git a/src/tool_operate.c b/src/tool_operate.c
index 932dda6e0..626c30888 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -456,8 +456,7 @@ static CURLcode operate_do(struct GlobalConfig *global,
            the number of resources as urlnum. */
         urlnum = count_next_metalink_resource(mlfile);
       }
-      else
-      if(!config->globoff) {
+      else if(!config->globoff) {
         /* Unless explicitly shut off, we expand '{...}' and '[...]'
            expressions and return total number of URLs in pattern set */
         result = glob_url(&urls, urlnode->url, &urlnum,
@@ -1858,8 +1857,7 @@ static CURLcode operate_do(struct GlobalConfig *global,
              */
             break;
         }
-        else
-        if(urlnum > 1) {
+        else if(urlnum > 1) {
           /* when url globbing, exit loop upon critical error */
           if(is_fatal_error(result))
             break;
diff --git a/tests/libtest/stub_gssapi.c b/tests/libtest/stub_gssapi.c
index 168becf88..883cc1900 100644
--- a/tests/libtest/stub_gssapi.c
+++ b/tests/libtest/stub_gssapi.c
@@ -324,7 +324,7 @@ OM_uint32 gss_display_status(OM_uint32 *min,
     if(status_string->value)
       status_string->length = strlen(status_string->value);
     else
-       return GSS_S_FAILURE;
+      return GSS_S_FAILURE;
   }
 
   return GSS_S_COMPLETE;

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]