Permalink
Browse files

checksrc: whitespace and code style cleanup

Make everything adhere to the standards upheld by checksrc.pl and now
run checksrc from the makefile on debug builds.
  • Loading branch information...
bagder committed Apr 25, 2011
1 parent 6a69815 commit aa87f0ab15c15784c4d7ee55e8c5972f5353b41e
Showing with 148 additions and 122 deletions.
  1. +9 −1 src/Makefile.am
  2. +0 −1 src/config-riscos.h
  3. +4 −2 src/config-win32.h
  4. +15 −13 src/getpass.c
  5. +9 −9 src/homedir.c
  6. +63 −53 src/main.c
  7. +3 −2 src/setup.h
  8. +28 −28 src/urlglob.c
  9. +5 −5 src/writeenv.c
  10. +9 −5 src/writeout.c
  11. +3 −3 src/xattr.c
View
@@ -5,7 +5,7 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
-# Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
+# Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
@@ -95,3 +95,11 @@ $(HUGE):
echo '#include "hugehelp.h"' >> $(HUGE)
echo "void hugehelp(void) {}" >>$(HUGE)
endif
+
+if CURLDEBUG
+# for debug builds, we scan the sources on all regular make invokes
+# ignore hugehelp.c since it is generated source code and it plays by slightly
+# different rules!
+all-local:
+ @@PERL@ $(top_srcdir)/lib/checksrc.pl -D$(top_srcdir)/src -Whugehelp.c $(curl_SOURCES)
+endif
View
@@ -1,4 +1,3 @@
-/* curl_config.h.in. Generated automatically from configure.in by autoheader. */
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
View
@@ -323,7 +323,8 @@
2000 as a supported build target. VS2008 default installations provide an
embedded Windows SDK v6.0A along with the claim that Windows 2000 is a
valid build target for VS2008. Popular belief is that binaries built using
- Windows SDK versions 6.X and Windows 2000 as a build target are functional */
+ Windows SDK versions 6.X and Windows 2000 as a build target are
+ functional */
#if defined(_MSC_VER) && (_MSC_VER >= 1500)
# define VS2008_MINIMUM_TARGET 0x0500
#endif
@@ -344,7 +345,8 @@
# ifndef WINVER
# define WINVER VS2008_DEFAULT_TARGET
# endif
-# if (_WIN32_WINNT < VS2008_MINIMUM_TARGET) || (WINVER < VS2008_MINIMUM_TARGET)
+# if (_WIN32_WINNT < VS2008_MINIMUM_TARGET) || \
+ (WINVER < VS2008_MINIMUM_TARGET)
# error VS2008 does not support Windows build targets prior to Windows 2000
# endif
#endif
View
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -78,7 +78,7 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen)
buffer[0]='\0';
sts = sys$assign(&ttdesc, &chan,0,0);
- if (sts & 1) {
+ if(sts & 1) {
sts = sys$qiow(0, chan,
IO$_READPROMPT | IO$M_NOECHO,
&iosb, 0, 0, buffer, buflen, 0, 0,
@@ -113,12 +113,12 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen)
for(i=0; i<buflen; i++) {
buffer[i] = (char)getch();
- if ( buffer[i] == '\r' || buffer[i] == '\n' ) {
+ if(buffer[i] == '\r' || buffer[i] == '\n') {
buffer[i] = 0;
break;
}
else
- if ( buffer[i] == '\b')
+ if(buffer[i] == '\b')
/* remove this letter and if this is not the first key, remove the
previous one as well */
i = i - (i>=1?2:1);
@@ -128,7 +128,7 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen)
fputs("\n", stderr);
#endif
/* if user didn't hit ENTER, terminate buffer */
- if (i==buflen)
+ if(i==buflen)
buffer[buflen-1]=0;
return buffer; /* we always return success */
@@ -153,20 +153,22 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen)
printf("%s", prompt);
do {
buffer[i++] = getch();
- if (buffer[i-1] == '\b') {
+ if(buffer[i-1] == '\b') {
/* remove this letter and if this is not the first key,
remove the previous one as well */
- if (i > 1) {
+ if(i > 1) {
printf("\b \b");
i = i - 2;
- } else {
+ }
+ else {
RingTheBell();
i = i - 1;
}
- } else if (buffer[i-1] != 13) {
- putchar('*');
}
- } while ((buffer[i-1] != 13) && (i < buflen));
+ else if(buffer[i-1] != 13)
+ putchar('*');
+
+ } while((buffer[i-1] != 13) && (i < buflen));
buffer[i-1] = 0;
printf("\r\n");
return buffer;
@@ -194,8 +196,8 @@ static bool ttyecho(bool enable, int fd)
static struct_term noecho;
#endif
if(!enable) {
- /* disable echo by extracting the current 'withecho' mode and remove the
- ECHO bit and set back the struct */
+ /* disable echo by extracting the current 'withecho' mode and remove the
+ ECHO bit and set back the struct */
#ifdef HAVE_TERMIOS_H
tcgetattr(fd, &withecho);
noecho = withecho;
View
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -54,23 +54,23 @@ char *GetEnv(const char *variable, char do_expand)
* started. Don't accept truncated results (i.e. rc >= sizeof(buf1)). */
rc = GetEnvironmentVariable(variable, buf1, sizeof(buf1));
- if (rc > 0 && rc < sizeof(buf1)) {
+ if(rc > 0 && rc < sizeof(buf1)) {
env = buf1;
variable = buf1;
}
- if (do_expand && strchr(variable,'%')) {
+ if(do_expand && strchr(variable,'%')) {
/* buf2 == variable if not expanded */
rc = ExpandEnvironmentStrings (variable, buf2, sizeof(buf2));
- if (rc > 0 && rc < sizeof(buf2) &&
- !strchr(buf2,'%')) /* no vars still unexpanded */
+ if(rc > 0 && rc < sizeof(buf2) &&
+ !strchr(buf2,'%')) /* no vars still unexpanded */
env = buf2;
}
#else
(void)do_expand;
#ifdef __VMS
env = getenv(variable);
- if (env && strcmp("HOME",variable) == 0) {
- env = decc_translate_vms(env);
+ if(env && strcmp("HOME",variable) == 0) {
+ env = decc_translate_vms(env);
}
#else
/* no length control */
@@ -97,13 +97,13 @@ char *homedir(void)
{
struct passwd *pw = getpwuid(geteuid());
- if (pw) {
+ if(pw) {
#ifdef __VMS
home = decc_translate_vms(pw->pw_dir);
#else
home = pw->pw_dir;
#endif
- if (home && home[0])
+ if(home && home[0])
home = strdup(home);
else
home = NULL;
Oops, something went wrong.

0 comments on commit aa87f0a

Please sign in to comment.