examples: adhere to curl code style

All plain C examples now (mostly) adhere to the curl code style. While
they are only examples, they had diverted so much and contained all
sorts of different mixed code styles by now. Having them use a unified
style helps users and readability. Also, as they get copy-and-pasted
widely by users, making sure they're clean and nice is a good idea.

573 checksrc warnings were addressed.
This commit is contained in:
Daniel Stenberg
2016-02-11 09:42:38 +01:00
parent 936d8f07df
commit 3a6563d668
54 changed files with 821 additions and 766 deletions

View File

@@ -49,10 +49,11 @@ CURLcode my_conv_from_ascii_to_ebcdic(char *buffer, size_t length)
int rc;
tempptrin = tempptrout = buffer;
rc = platform_a2e(&tempptrin, &bytes, &tempptrout, &bytes);
if (rc == PLATFORM_CONV_OK) {
return(CURLE_OK);
} else {
return(CURLE_CONV_FAILED);
if(rc == PLATFORM_CONV_OK) {
return CURLE_OK;
}
else {
return CURLE_CONV_FAILED;
}
}
@@ -63,10 +64,11 @@ CURLcode my_conv_from_ebcdic_to_ascii(char *buffer, size_t length)
int rc;
tempptrin = tempptrout = buffer;
rc = platform_e2a(&tempptrin, &bytes, &tempptrout, &bytes);
if (rc == PLATFORM_CONV_OK) {
return(CURLE_OK);
} else {
return(CURLE_CONV_FAILED);
if(rc == PLATFORM_CONV_OK) {
return CURLE_OK;
}
else {
return CURLE_CONV_FAILED;
}
}
@@ -77,10 +79,11 @@ CURLcode my_conv_from_utf8_to_ebcdic(char *buffer, size_t length)
int rc;
tempptrin = tempptrout = buffer;
rc = platform_u2e(&tempptrin, &bytes, &tempptrout, &bytes);
if (rc == PLATFORM_CONV_OK) {
return(CURLE_OK);
} else {
return(CURLE_CONV_FAILED);
if(rc == PLATFORM_CONV_OK) {
return CURLE_OK;
}
else {
return CURLE_CONV_FAILED;
}
}