• src/xpdev/genwrap.c

    From Deucе@1:103/705 to Git commit to main/sbbs/master on Fri Feb 11 20:49:58 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/f587a43e6fee5458e3376d5a
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    When a double is cast to an int, but the double has a larger valuethan the int supports, it's set to 0x80000000 to indicate overflow.msclock() is *always* overflowing, and clock_t is only 32-bits onsome platforms (specifically FreeBSD). To "avoid" problems, justkeep subtracting UIN32_MAX from the value until it's less than INT_MAXthen cast.This function is, of course, terrible and shouldn't actually be used,but it should at least sorta kinda workish.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Fri Feb 11 23:43:24 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/d2eda12d2c30356cc14461d5
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Fix Win32 builds maybe?
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Fri Feb 11 23:47:10 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/e7761bb1b03cbbf6b3ab0662
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Fix Win32 harder
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Fri Feb 11 23:49:48 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/c3c6d783f4da67a9b2a1f1ed
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Moar!
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to Git commit to main/sbbs/master on Sat Feb 12 00:00:22 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/f0a83672aa0c8d0d638bfd62
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Resolve new msvc warningwarning C4244: '=': conversion from 'double' to 'uint64_t', possible loss of data
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Sat Feb 12 00:07:16 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/f8da2a2f2ff8668017906f48
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    More Win32 optimizations.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Sat Feb 12 00:15:38 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/7d1fc057418fe859028b1c54
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    More Win32 optimizations.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Sat Feb 12 00:40:30 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/489c0c3c20b98f74f54046d0
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Borland doesn't have roundl() so do terrible things instead.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Sat Feb 12 00:45:48 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/0488082a3e46f9cd25efc140
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Not *that* t.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to Git commit to main/sbbs/master on Fri Feb 25 14:30:46 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/7a3dcb6c2ad19812fd674660
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Fix MSVC warning in xp_timer64()genwrap.c(855): warning C4244: '=': conversion from 'LONGLONG' to 'uint32_t', possible loss of data
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to Git commit to main/sbbs/master on Wed Jul 6 21:18:34 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/a302a01b1b42887cdece9b23
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Escape chars >= 0x7f too (DEL and ex-ASCII/UTF-8 and whatnot)
    --- SBBSecho 3.15-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (in GitKraken)@1:103/705 to Git commit to main/sbbs/master on Sat Mar 11 17:27:02 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/7081a525902dcc4acf4f00a2
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Fix mysterious double overflow issue in parse_byte_count()It's possible that some values (e.g. "16384P") exceed the storage (count ofbytes) of a 64-bit integer, and such values were causing floating pointexceptions when running sbbsctrl.exe, e.g.Faulting application name: sbbsctrl.exe, version: 3.20.0.0, time stamp:0x00000000Faulting module name: gdi32full.dll, version: 10.0.19041.2604, time stamp:0x2b5302d5Exception code: 0xc0000090but interesting (and perhaps a clue), not with sbbs.exe.Anyway, this added range checking, limiting the maximum value to INT64_MAX(after division by unit, though there was no division-unit in the problemcase, the "min_dspace" value parsing in scfglib2.c). Using conditional/ternaryreturn statement had the same floating point exception occurrences, so thisif-statement shouldn't be removed/changed/optimized!I suspect this has something to do with mix of Borland and MSVC run-time libsand perhaps different expectations or setups with regards to floating pointexceptions. I did notice that when stepping through read_file_cfg(), I wouldget different return values for the same call to iniGetBytes() depending onwhether it was initiated from sbbsctrl.exe (built with C++Builder) orsbbs.dll (built with MSVC).Thanks to Codefenix for providing the sample file.ini file that demonstratedthe issue. This problem would've been very hard to root-cause otherwise!
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (in GitKraken)@1:103/705 to Git commit to main/sbbs/master on Fri Mar 17 19:26:54 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/973b548fcd8c126de3633b5c
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Use const doubles for time durationsInstead of copy/pasta. No change in function,.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Tue Mar 28 15:27:08 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/ea44c50ad1ffe1a9cef1a7ff
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Fix clang warning: implicit conversion from 'long' to 'double'changes value from 9223372036854775807 to 9223372036854775808[-Wimplicit-const-int-float-conversion] if(bytes < 0 || bytes > INT64_MAX) ~ ^~~~~~~~~/usr/include/x86/_stdint.h:90:19: note: expanded from macro 'INT64_MAX' #define INT64_MAX 0x7fffffffffffffff ^~~~~~~~~~~~~~~~~~
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Mon Dec 18 02:32:04 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/58b4de5093abeb6c7d2371f1
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    The %g printf specifier doesn't work the same as %f, use %f instead
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Mon Dec 18 17:21:36 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/9031ac11bbc1003e9cd13f3e
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Cosmetic improvements to duration*_to_[v]str() functions

    Use lower case y/w/d/h/m suffix.

    If a duration is an exact multiple, don't display ".0" fraction. This is not consistent with byte_estimate_to_str() string generation, but I think it's
    more in line with human expectations.

    Don't display "90d" as "12.9w" (unless the requested unit is one-week).
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Sat Feb 24 02:08:24 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/984f1eb68d22b45de08fd723
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Insure all builds of safe_strerror() write the string to the passed buf

    The GNU_SOURCE build of this function was (sometimes?) just returning the string and not actually copying it to the passed buf. This is consistent
    with the GNU manpage on strerror_r():
    "This may be either a pointer to a string that the function stores in buf ..." but was inconsistent with all the other build types of this function.

    Also updated to use strlcpy and write the problematic error number to the default string (if unknown).
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Fri Mar 22 11:31:26 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/0d60813bb295908d35ad556e
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Fix issue in last commit

    Need to update the parameter names as well.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Sat Mar 23 00:10:08 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/78ae0fd80623b830fe86b6d6
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Change spaces to tabs in new strlcpy()
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)