Permalink
Switch branches/tags
Nothing to show
Commits on Jul 10, 2010
  1. Fix warning in util.h (signed vs unsigned comparison)

    This fix had been delayed by Ramsay because on 32-bit systems it
    highlights the fact that off_t is set to an invalid value.
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    vmg committed Jul 10, 2010
Commits on Jun 7, 2010
  1. msvc: Disable a level 4 warning and change -W3 to -W4

    Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
    Ramsay Jones committed Jun 3, 2010
  2. Makefile(s): Add -Wextra to CFLAGS

    Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
    Ramsay Jones committed Jun 7, 2010
  3. Add a 'git__' prefix to the block-sha1 functions

    This reduces the global namespace pollution. These functions
    were the only remaining external symbols (with the exception
    of an PPC_SHA1 build) which did not start with 'git', and
    since these are private library symbols the 'git__' prefix is
    appropriate.
    
    Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
    Ramsay Jones committed Jun 5, 2010
  4. Remove the sha1.h header file and inline the content into hash.c

    Given that the sha1.h header file should never be included into
    any other file, since it represents an implementation detail of
    hash.c, we remove the header and inline it's content.
    
    Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
    Ramsay Jones committed Jun 4, 2010
  5. msvc: Select the "fast" definition of the {get,put}_be32() macros

    On Intel machines, the msvc compiler defines the CPU architecture
    macros _M_IX86 and _M_X64 (equivalent to __i386__ and __x86_64__
    respectively). Use these macros in the pre-processor expression
    to select the "fast" definition of the {get,put}_be32() macros.
    
    Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
    Ramsay Jones committed May 13, 2010
  6. Makefile: Add a target to generate C preprocessor output files

    Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
    Ramsay Jones committed May 13, 2010
  7. Fix a bug in the git_oid_to_string() function

    When git_oid_to_string() was passed a buffer size larger than
    GIT_OID_HEXSZ+1, the function placed the c-string NUL char at
    the wrong position. Fix the code to place the NUL at the end
    of the (possibly truncated) oid string.
    
    Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
    Ramsay Jones committed Jun 2, 2010
Commits on Jun 2, 2010
  1. Style: Do not use (C99) // comments

    Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
    Signed-off-by: Andreas Ericsson <ae@op5.se>
    Ramsay Jones committed with ageric Jun 1, 2010
  2. Style: Fix brace placement and spacing

    Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
    Signed-off-by: Andreas Ericsson <ae@op5.se>
    Ramsay Jones committed with ageric Jun 1, 2010
  3. Fix a memory leak shown by valgrind

    Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
    Signed-off-by: Andreas Ericsson <ae@op5.se>
    Ramsay Jones committed with ageric Jun 1, 2010
  4. Fix inconsistent definition of off_t on Linux

    In order to avoid inconsistent definitions of type off_t, all
    compilation units should include the "common.h" header file
    before certain system headers (those which directly or indirectly
    lead to the definition of off_t). The "common.h" header contains
    the definition of _FILE_OFFSET_BITS to select 64-bit file offsets.
    
    The symptom of this inconsistency, while compiling with -Wextra, is
    the following warning:
    
        In file included from src/common.h:50,
                         from src/commit.c:28:
        src/util.h: In function git__is_sizet:
        src/util.h:41: warning: comparison between signed and unsigned
    
    In order to fix the problem, we simply remove the #include <time.h>
    statement at the head of src/commit.c.  Note that src/commit.h also
    includes <time.h>.
    
    Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
    Signed-off-by: Andreas Ericsson <ae@op5.se>
    Ramsay Jones committed with ageric Jun 1, 2010
  5. Fix a "dereference of type-punned pointer" compiler warning

    gcc (4.4.0) issues the following warning:
    
        src/revobject.c:33: warning: dereferencing type-punned pointer \
            will break strict-aliasing rules
    
    We suppress the warning by copying the first 4 bytes from the oid
    structure into an 'unsigned int' using memcpy(). This will also
    fix any potential alignment issues on certain platforms.
    
    Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
    Signed-off-by: Andreas Ericsson <ae@op5.se>
    Ramsay Jones committed with ageric Jun 1, 2010
  6. Fix a doxygen warning

    In particular, doxygen issues the following warning:
    
        .../src/git/revwalk.h:86: Warning: The following parameters of \
            gitrp_sorting(git_revpool *pool, unsigned int sort_mode) are \
            not documented:
              parameter 'pool'
    
    Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
    Signed-off-by: Andreas Ericsson <ae@op5.se>
    Ramsay Jones committed with ageric Jun 1, 2010
  7. Fix sparse warnings: "symbol not declared. Should it be static?"

    In particular, sparse issues the following warnings:
    
        src/revobject.c:29:14: warning: symbol 'max_load_factor' was \
            not declared. Should it be static?
        src/revobject.c:31:14: warning: symbol 'git_revpool_table__hash' was \
            not declared. Should it be static?
    
    In order to suppress these warnings, we simply declare them as
    static, since they are not (currently) referenced outside of this
    file.
    
    In the case of max_load_factor, this is probably correct. However,
    this may not be appropriate for git_revpool_table__hash(), given
    how it is named. So, this should either be re-named to reflect it's
    non-external status, or a declaration needs to be added to the
    revobject.h header file.
    
    Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
    Signed-off-by: Andreas Ericsson <ae@op5.se>
    Ramsay Jones committed with ageric Jun 1, 2010
  8. Fix sparse warnings: "Using plain integer as NULL pointer"

    In order to suppress this warning, we could simply replace the
    constant 0 with NULL. However, in this case, replacing the
    comparison with 0 by !buffer is more idiomatic.
    
    Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
    Signed-off-by: Andreas Ericsson <ae@op5.se>
    Ramsay Jones committed with ageric Jun 1, 2010
  9. msvc: tests/t0403-lists.c: Fix a compiler warning

    For more recent versions of msvc, the time_t type, as returned by
    the time() function, is a 64-bit type. The srand() function, however,
    expects an 'unsigned int' input parameter, leading to the warning.
    
    Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
    Signed-off-by: Andreas Ericsson <ae@op5.se>
    Ramsay Jones committed with ageric Jun 1, 2010
  10. msvc: Fix an "conversion, loss of data" compiler warning

    In particular, the compiler issues the following warning:
    
        src/revwalk.c(61) : warning C4244: '=' : conversion from \
            'unsigned int' to 'unsigned char', possible loss of data
    
    In order to suppress the warning, we change the type of the
    sorting "enum" field of the git_revpool structure to be consistent
    with the sort_mode parameter of the gitrp_sorting() function.
    
    Note that if the size of the git_revpool structure is an issue,
    then we could change the type of the sort_mode parameter instead.
    
    Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
    Signed-off-by: Andreas Ericsson <ae@op5.se>
    Ramsay Jones committed with ageric Jun 1, 2010
  11. msvc: Fix some compiler warnings

    In particular, the compiler issues the following warnings:
    
        src/revobject.c(29) : warning C4305: 'initializing' : truncation \
            from 'double' to 'const float'
        src/revobject.c(56) : warning C4244: '=' : conversion from \
            'const float' to 'unsigned int', possible loss of data
        src/revobject.c(149) : warning C4244: '=' : conversion from \
            'const float' to 'unsigned int', possible loss of data
    
    In order to suppress the warnings we change the type of max_load_factor
    to double, rather than change the initialiser to 0.65f, and cast the
    result type of the expressions to 'unsigned int' as expected by the
    assignment operators. Note that double should be able to represent all
    unsigned int values without loss.
    
    Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
    Signed-off-by: Andreas Ericsson <ae@op5.se>
    Ramsay Jones committed with ageric Jun 1, 2010
  12. Fix some "signed/unsigned comparison" compilation warnings

    These warnings are issued by both gcc (-Wextra) and msvc (-W3).
    
    Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
    Signed-off-by: Andreas Ericsson <ae@op5.se>
    Ramsay Jones committed with ageric Jun 1, 2010
  13. Fix a memory corruption runtime error

    On the msvc build, the tests t0401-parse and t0501-walk both
    crash with a runtime error (ACCESS_VIOLATION). This is caused
    by writing to un-allocated memory due to an under-allocation
    of a git_revpool_table data structure.
    
    Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
    Signed-off-by: Andreas Ericsson <ae@op5.se>
    Ramsay Jones committed with ageric Jun 1, 2010
  14. msvc: Fix a "declaration after statement" compilation error

    Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
    Signed-off-by: Andreas Ericsson <ae@op5.se>
    Ramsay Jones committed with ageric Jun 1, 2010
  15. Improved error handling on auxilirary functions.

    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    Signed-off-by: Andreas Ericsson <ae@op5.se>
    vmg committed with ageric May 28, 2010
  16. Use the first 4 bytes of an OID as hash, instead of full hashing.

    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    Signed-off-by: Andreas Ericsson <ae@op5.se>
    vmg committed with ageric May 27, 2010
  17. Added new error codes. Improved error handling.

    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    Signed-off-by: Andreas Ericsson <ae@op5.se>
    vmg committed with ageric May 27, 2010
  18. Removed trailing whitespace.

    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    Signed-off-by: Andreas Ericsson <ae@op5.se>
    vmg committed with ageric May 27, 2010
  19. Fixed brace placement and converted spaces to tabs.

    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    Signed-off-by: Andreas Ericsson <ae@op5.se>
    vmg committed with ageric May 27, 2010
  20. Added t0501-walk (simple test for all revision pool walking modes)

    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    Signed-off-by: Andreas Ericsson <ae@op5.se>
    vmg committed with ageric May 26, 2010
  21. Fixed topological commit sorting (no longerd reversed) and commit time

    sorting ('prev' pointers in the linked list are no longer lost).
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    Signed-off-by: Andreas Ericsson <ae@op5.se>
    vmg committed with ageric May 25, 2010
  22. Fixed topological sorting stuck in infinite loop.

    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    Signed-off-by: Andreas Ericsson <ae@op5.se>
    vmg committed with ageric May 25, 2010
  23. Fixed parsing commit times (they weren't being stored at all!)

    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    Signed-off-by: Andreas Ericsson <ae@op5.se>
    vmg committed with ageric May 25, 2010
  24. Changed commit time sorting to be descending (from newest to oldest).

    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    Signed-off-by: Andreas Ericsson <ae@op5.se>
    vmg committed with ageric May 25, 2010
  25. Add external API for revision sorting.

    The GIT_RPSORT_XXX flags have been moved to the external API,
    and a new method 'gitrp_sorting(...)' has been added to safely
    change the sorting method of a revision pool.
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    Signed-off-by: Andreas Ericsson <ae@op5.se>
    vmg committed with ageric May 25, 2010
  26. Properly reset all commit properties when doing a gitrp_reset().

    Add git_revpool_table_free() method.
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    Signed-off-by: Andreas Ericsson <ae@op5.se>
    vmg committed with ageric May 23, 2010
  27. Add topological sorting and new insertion methods for commit lists.

    'git_commit_list_toposort()' and 'git_commit_list_timesort()' now
    sort a commit list by topological and time order respectively.
    Both sorts are stable and in place.
    
    'git_commit_list_append' has been replaced by 'git_commit_list_push_back'
    and 'git_commit_list_push_front'.
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    Signed-off-by: Andreas Ericsson <ae@op5.se>
    vmg committed with ageric May 23, 2010