Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#22 Misc Bug fixes (thank you, G++!)

open-accepted
Daler
None
9
2002-02-26
2002-02-12
Steven Augart
No

Summary: This patch contains fixes for the causes of
various warnings that were flagged by aggressive use of
the g++ warning options. At least some of these
warnings pointed out cases in the code that would have
caused crashes or undesired behavior.

Also includes additional conversions from using
integer error codes
to using the Ťenum errorsť error codes. Revised the
error code
system to use the predicates isSuccess() and
isFailure().

Unpatcking instructions included in the patch.

Long Description (this is identical to the contents of
the .msg-2 files):

MIME.cpp: Converted more code to use enum errors.
Added comments.
Commented out unused code.
Revised decode64() to be more robust: (a) added
assertions.
(b) added comments
(c) moved variables from function-scope into the
innermost
appropriate block.

MIME.h: Match changes in MIME.cpp

callbacks.cpp: Added error checking to the call to
decode64.
Improved error messages by calls to the new
error_sprintf() function.

errors.cpp: Renamed Fail() and Success() to isFailure()
and
isSuccess(), so that it's clearer to the reader that
they're boolean
tests.

errors.h: Match changes made to internal_error.cpp and
errors.cpp

internal_error.cpp: Renamed internal_error(const char
[], ...) to
internal_error_sprintf(). This fixes a link-time
conflict between
that function and internal_error(const char[]); the
signatures were
too close for the compiler to distinguish.

Also fixed bug in use of va_end() in
internal_error_sprintf(). This
would not have shown up except on certain odd
platforms; va_end() is
usually a no-op.

tcpUtilities.cpp: Added assertions and calls to
internal_error() to
confirm that Althea doesn't try to use SSL without
having SSL
compiled in. Like the standard assert() macro, these
are disabled
by compiling code with -DNDEBUG.

Modified ReadFromSocket() to clear up a
possibly-used-without-set warning.
Added comments.

SelectFolder.cpp: More use of enum errors instead of
int error codes.
Use assertions to catch any cases of what the
compiler warned of as
a possibly-used-before-set bug,

SelectFolder.h: Change function prototypes to reflect
changes to SelectFolder.cpp.

Server.cpp: Used #if 0 to comment out incomplete code
that is never
used. (The incomplete code justifiably triggers
compiler warnings.)

load_config.cpp: Used #if 0 to comment out unused
code.

load_config.h: #if 0 to comment out unused function
declaration.

Makefile: Added a useful development target to the
Makefile,
.cpp.i. This lets us generate .i files containing
preprocessed versions of the source.

support.cpp: New function, error_sprintf(). Formats an
error message
and then displays it by calling the existing error()
function.

support.h: Added prototype to match addition of
error_sprintf() to support.cpp.

Discussion

  • Steven Augart
    Steven Augart
    2002-02-12

     
    Attachments
  • Steven Augart
    Steven Augart
    2002-02-12

    • priority: 5 --> 8
     
  • Daler
    Daler
    2002-02-26

    • priority: 8 --> 9
    • assigned_to: nobody --> mulvihiw
    • status: open --> closed-accepted
     
  • Daler
    Daler
    2002-02-26

    Logged In: YES
    user_id=99089

    The althea developers have decided to include your patch in the
    main source. Usually, your patch will be uploaded to the CVS
    source first and included in the next release of althea. Thanks
    for your contribution and keep submitting!

     
  • Daler
    Daler
    2002-02-26

    Logged In: YES
    user_id=99089

    Oops. I clicked the wrong patch. But will probably upload
    this one soon.

     
  • Daler
    Daler
    2002-02-26

    • status: closed-accepted --> open-accepted