Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Branch: master
Commits on May 27, 2009
  1. make common error strings more descriptive

    Add more descriptive error strings for common errors, namely
  2. define a mask for formats file errors

    Add a mask for errors related to the formats file.  This will make it
    easier for library users to determine whether an error was related to the
    formats file by masking the error with BCERR_MASK_FORMAT.
Commits on May 26, 2009
  1. bc_strerror: put case and return on separate lines

    In bc_strerror, move the return statement to the line below the case
    statement for each case.  These are purely whitespace changes; there is no
    functional change.  This change is being made in preparation for the next
    change, which will add to the existing error strings.  It is preferable to
    keep these as separate changes so that it's easier to see which error
    strings are added to.
Commits on May 25, 2009
  1. add "Bit Inspector test bitstream" to formats file

    Add the Bit Inspector test bitstream, which is displayed in the
    instructions shown at the top of the Bit Inspector window, to the formats
    file.  This allows users to see how the fields table in Bit Inspector
    works using the default test bitstream.  Previously, it may not have been
    obvious to the user that a fields table existed unless they found another
    bitstream to use that was recognized by the formats file.
  2. $(LDFLAGS) must be at the end of the link options

    The implicit link command in GNU make places $(LDFLAGS) just after $(CC).
    This causes linking to fail on MinGW gcc 3.4.2 because of "undefined
    reference" errors for libpcre functions.  Placing $(LDFLAGS) at the end of
    the link options fixes the problem.
  3. add support for custom static libpcre

    When building, the Makefile now checks if ../pcre exists and uses it for
    the libpcre include and library files.  It assumes that such a libpcre
    should be linked statically with libbitconvert.  This option is useful on
    systems where a binary distributable that uses libbitconvert should contain
    both libbitconvert and libpcre, such as on Windows and Mac OS X.
  4. use $(AR), $(RM), and local variables

    Replace "ar" and "rm" with "$(AR)" and "$(RM)" so that the Makefile uses
    the correct ar and rm.  Note that "$(RM)" expands to "rm -f" on GNU and
    Solaris systems (probably POSIX) so an explicit "-f" is unneeded.
    Replace explicit target and source with "$@" and "$<" to make the archive
    rule more versatile (easier to copy into new rules).
    These changes were suggested by Stephen Paul Weber.
  5. add missing .PHONY rule

    Add a .PHONY rule indicating that "all" and "clean" are phony targets.
    This correction was suggested by Stephen Paul Weber.
  6. add missing binary to clean rule

    Add "combine" to the list of files to be deleted in the "clean" rule.
    This omission was caught by Stephen Paul Weber.
  7. change to implicit rules where possible

    Remove explicit build lines where they are unneeded.  Add an LDFLAGS line
    to ensure libpcre is linked in.  This change is based on suggestions from
    Stephen Paul Weber.
  8. add note about why CC is set to gcc

    Added a comment describing that CC is set to gcc because CFLAGS uses
    gcc-specific flags.  If the user wishes to use a different CC, they can
    remove the gcc-specific flags and then change or remove the CC line.
Commits on May 23, 2009
  1. add note about core.autocrlf git option to README

    Add a paragraph to the README file recommending that Windows users turn on
    the "core.autocrlf" option in git before checking out the project to make
    editing easier.
  2. add .txt extension to README and COPYING files

    Rename README and COPYING to README.txt and COPYING.txt.  This will allow
    users on Windows to read them more easily.  This change was already made
    to the formats file (see commit 0da1c0d).
  3. move formats file to formats.txt

    The formats file is now located at "formats.txt" instead of "formats".
    This change was made to make it easier for Windows users to modify the
    formats file.  Double-clicking on the formats file in Windows will now
    open it in Notepad.  Developers on Windows should turn on the
    "core.autocrlf" option in git:
    	git config --global core.autocrlf true
    This will cause the checked out files to use Windows-style newlines, which
    Notepad can read.  Without this option, the newlines will be Unix-style
    and Notepad will not read them correctly.
    Although the formats file could have been stored in the repository with
    Windows-style newlines, that option is not feasible because the
    libbitconvert codebase cannot handle such a formats file when compiled on
    a Unix-like system.  However, the libbitconvert codebase works with such a
    formats file when compiled with the MinGW compiler on Windows.  As a
    result, storing the formats file with Unix-style newlines and having git
    deal with the newline conversion on Windows is the most feasible option.
  4. remove error code BCERR_INVALID_TRACK

    The BCERR_INVALID_TRACK error code is no longer used.  It was phased out
    when libbitconvert switched to accepting all tracks at once rather than
    accepting each track individually, in which case the track number was
    specified for each track.  This change was made in commit 7d77d2d.
  5. remove error code BCERR_RESULT_FULL

    BCERR_RESULT_FULL is no longer used because the result fields are
    dynamically allocated.
Commits on Apr 13, 2009
  1. fix bc_decoded_free to prevent bad free call

    Prior to this fix, if the library user called bc_decode and then
    bc_decoded_free, the library would segfault because result->field_values
    was not initialized and the library tried to free it.  This bug had been
    hidden because all library users so far have called bc_find_fields after
    bc_decode, which initializes result->field_values.
    This fix checks result->field_names before freeing other result->field_*
    values.  This works because result->field_names is always initialized.
Commits on Mar 31, 2009
  1. fix deletion error

    Removed "from ", which should have been removed in the last commit.
  2. add more information to build requirements list

    Add compiler requirement to all OSes in the list (build-essential,
    Xcode, MinGW) and add information about installing libpcre on Mac using
Commits on Mar 28, 2009
  1. @dj3vande

    fixed an apparent off-by-1 error in skip_fields

    dj3vande authored
    "Do we need to skip?" check was 'k + 1 < num_fields'; this incorrectly
    decides NOT to skip when we get a RE match fail with precisely one
    field that needs to be skipped.
Commits on Mar 6, 2009
  1. @dj3vande

    fixups to match Denver's style preferences.

    dj3vande authored
    Added space after comma in function calls
    Moved initializations-at-declaration to a chunk of initializations
    after the declarations.
  2. @dj3vande

    fixed bug introduced in commit 3fe69c2

    dj3vande authored
    Replaced '*buf = realloc...' with 't = realloc...', but forgot to
    replace 'if (NULL == *buf)' with 'if (NULL == t)'.
  3. @dj3vande

    bc_decode_track_fields error handling cleanup #2

    dj3vande authored
    Now uses a temporary for realloc's return value, to avoid leaking
    memory on realloc failure.
  4. @dj3vande

    bc_decode_track_fields error handling cleanup #1

    dj3vande authored
    Now always moves current file position past the current set of track
    fields, and cleanly deallocates memory that we still have pointers
    to, for every possible failure.  (Fixing realloc leaks will be #2.)
  5. @dj3vande

    fixed types

    dj3vande authored
    Changed type of variables tracking memory sizes into size_t
  6. @dj3vande


    dj3vande authored
  7. fix comment to use correct "null" descriptor

    The term "NULL" should only be used to refer to the null pointer.  This
    fix corrects this use of "NULL", suggested by Dave Vandervies.
Commits on Mar 3, 2009
  1. make ovector dynamically allocated (the last one)

    ovector, the vector passed into pcre_exec that holds the offsets of the
    captured substrings, is now dynamically allocated.  It is grown until
    pcre_exec returns non-zero, indicating that ovector was large enough or
    an error occurred.
    This change eliminates MAX_CAPTURED_SUBSTRINGS, which is no longer
    needed now that ovector is dynamically-sized.
    This change is the last one needed to make libbitconvert completely free
    of static buffers.  The test drivers (driver and combine) still have
    static buffers, but the library itself does not.
  2. make field_* arrays dynamically allocated

    Added array growing code to bc_decode_track_fields and a fields_size
    parameter to the bc_decode_track_fields interface for passing the
    current allocated size of the fields lists.  Added initial allocation of
    the fields lists in bc_decode_fields.  Updated bc_decode to initialize
    field_names to NULL, which is the new correct way to denote empty fields
    lists.  Added corresponding frees in bc_decoded_free.
    This change also removes BC_NUM_FIELDS, which is no longer needed
    because there are no statically-sized fields in struct bc_decoded
    anymore.  There is still the statically-sized ovector to fix in
    bc_decode_track_fields, though.
Commits on Mar 2, 2009
  1. update code to use consistent bracing conventions

    This is purely a coding style update.  Most of it is moving braces to be
    consistent with the other code.  Some braces were also added for
  2. add -Wextra to CFLAGS so all warnings are shown

    Previously only -Wall was used, which leaves out some warnings.  Using
    -Wall -Wextra should give us as many warnings as possible.
  3. remove unneeded emptying of field_names

    The emptying of field_names has been removed because it is unneeded:
    when control reaches the bottom of the bc_decode_fields loop,
    field_names is guaranteed to be empty already because rc is
    BCINT_NO_MATCH, which means that no field data was added to the field
    lists because bc_decode_track_fields has not started adding field data
    when it returns BCINT_NO_MATCH.
  4. make each field_name dynamically allocated

    Each field_name (one element of field_names) is now dynamically
    allocated.  This allows the field name to be copied via strcpy directly
    into the field_name.
    The field_names array is now NULL-terminated.  All lines of code that
    depended on the previous behavior (empty string-terminated list),
    including one in the test driver, have been updated with this new
    This change also removes BC_FIELD_SIZE, which is no longer needed
    because there are no more statically-sized string buffers, only
    statically-sized arrays that store strings.
  5. update each field_value to be dynamically sized

    This change was fairly simple because pcre_get_named_substring returns
    an already-allocated string, which can be assigned directly to the
    field_value (an element of field_values).  The appropriates frees were
    added to bc_decoded_free.
  6. add pcre_get_named_substring return code check

    Check the value of pcre_get_named_substring's return code to see if
    there were problems and return an error if there were.  Previously, the
    return code of pcre_get_named_substring was ignored, which could have
    led to segfaults or other problems given a malformed formats file.
Something went wrong with that request. Please try again.