Skip to content
Snippets Groups Projects
  1. Feb 24, 2024
  2. Feb 21, 2024
  3. Feb 20, 2024
  4. Feb 07, 2024
  5. Jan 26, 2024
  6. Jan 20, 2024
    • Rob Swindell's avatar
      The great BOOL->bool conversion in xpdev · cc98c9f1
      Rob Swindell authored
      Still using BOOL where we need Win32 API compatibility.
      Using JSBool instead of BOOL or bool where it matters.
      Changed most relevant TRUE/FALSE to true/false too (though it's not as critical).
      
      You shouldn't need to #include <stdbool.h> anywhere now - gen_defs.h should do that automatically/correctly based on the language/version/tool. In C23, stdbool.h isn't even needed for bool/true/false definitions (they're keywords), so we don't bother including stdbool.h in that case.
      Microsoft didn't define __STDC_VERSION__ in their older tool chains (even though they were C99 compatible and had stdbool.h), so we use a _MSC_VER check to know that there's a stdbool.h we should use in that case.
      
      For other/old compilers (e.g. Borland C) we #define bool/true/false following the pattern of stdbool.h (doesn't use a typedef).
      
      I didn't convert UIFC yet.
      
      This addresses issue #698
      cc98c9f1
  7. Dec 23, 2023
    • Rob Swindell's avatar
      Add/use realloc_or_free() instead of realloc() in some places · 6080737a
      Rob Swindell authored
      Where ever we assign the realloc() result to the same pointer we pass, use this new function instead to eliminate the cppcheck error reported by Nelgin:
      Common realloc mistake: 'p' nulled but not freed upon failure  [memleakOnRealloc]
      
      This isn't going to actually solve any memory leaks, it's just good practice for critical error (e.g. no memory error) handling.
      6080737a
  8. Dec 18, 2023
  9. Jun 26, 2023
    • Rob Swindell's avatar
      Eliminate STRERROR macro · 0eeca471
      Rob Swindell authored
      This macro hasn't done anything meaningful since we stopped using really old
      versions of Borland compilers (and std libraries) where strerror() returned a
      string terminated with a line-feed (\n) character.
      0eeca471
  10. May 10, 2023
  11. Apr 26, 2023
  12. Nov 12, 2022
  13. Mar 24, 2022
    • Rob Swindell's avatar
      byte-count to string routines type unsigned 64-bit int now · fcb6846b
      Rob Swindell authored
      We don't have a use case negative byte values in strings anywhere that I can think of.
      
      Created wrapper for MSFT _ui64toa_() - unsigned 64-bit integer to ASCII string.
      
      Add Petabyte (actually, Pebibyte) support to byte_count_to_str()  and byte_estimate_to_str().
      
      Removed 'B' suffix from byte_estimate_to_str() output for values < 1024. Callers may display this returned string followed by "bytes" (or similar) and thus the 'B' suffix is redundant in that case. If the caller needs a 'B' suffix, they can detect no suffix and add it.
      fcb6846b
  14. Mar 14, 2022
  15. Feb 12, 2022
  16. Oct 19, 2021
  17. Apr 05, 2021
  18. Jan 18, 2021
    • Rob Swindell's avatar
      Change STRERROR() to be just an alias for strerror() on all platforms · 4e2567ad
      Rob Swindell authored
      Its a terrible idea to modify the return value of strerror() on any platform. strerror() can (and often does) return immutable string constants - don't try to modify that string even if it does end in trailing white-space (find another solution to that). This change only affects non-*nix builds since we were already doing the right thing for *nix.
      4e2567ad
  19. Aug 16, 2020
  20. Aug 08, 2020
  21. Aug 03, 2020
  22. Apr 14, 2020
  23. Mar 22, 2020
  24. Sep 10, 2019
  25. Apr 11, 2019
  26. Jul 23, 2018
  27. Jul 20, 2018
    • rswindell's avatar
      Fixed strcasestr() for Windows - oops. · 491b9fa1
      rswindell authored
      Created byte_estimate_to_str(), much like byte_count_to_str(), except the
      byte count is rounded to the nearest tera/giga/mega/kilo-byte
      (technically tebi/gibi/mebi/kibi-byte, but ugh, I'm old-sk00l!).
      491b9fa1
  28. Jul 19, 2018
  29. Feb 16, 2018
  30. Nov 05, 2017
    • rswindell's avatar
      Created duration_to_vstr() - like duration_to_str(), but it appends a space · 5d2f6c7c
      rswindell authored
      then a clarifying or modifying word (year[s], month[s], day[s], etc.).
      parse_byte_count() and parse_duration() now support a space between the
      numeric value (decimal digits) and the modifier. Hopefully this doesn't break
      anything, but it makes parse_duration() compatible with the strings generated
      with duration_to_vstr(). We might want a verbose version of byte_count_to_str()
      in the future, so I figured it made sense to go ahead and add the white-space
      skipping/parsing to prase_byte_count() now.
      5d2f6c7c
  31. Nov 19, 2016
Loading