Changeset 1318 for cpp


Ignore:
Timestamp:
07/11/24 17:59:38 (6 months ago)
Author:
Maciej Komosinski
Message:

Cosmetic

Location:
cpp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpp/common/nonstd_math.h

    r1302 r1318  
    2525inline double rndDouble(double limit_exclusive) { return rndGetInstance().getDouble() * limit_exclusive; }
    2626inline unsigned int rndUint(unsigned int limit_exclusive) { return (unsigned int)(rndGetInstance().getDouble() * limit_exclusive); } //returns random from 0..limit_exclusive-1
    27 #ifndef __BORLANDC__ //for embarcadero 11u3, unsigned int and size_t are duplicates
    28 inline unsigned int rndUint(size_t limit_exclusive) {return rndUint((unsigned int)limit_exclusive);} //just an overload with size_t argument
     27#if !defined __BORLANDC__ && !defined __ARM_ARCH_7A__ //for 32-bit compilations (embarcadero 11u3 and clang android), unsigned int and size_t function variants are duplicates. Using templates to define an additional function variant only when size_t is different from unsigned int is such a hassle... especially that some variants are inline, some are not. Another approach would be to create a template for all types (or all integer types?) and potentially getting an overflow for longer int types when casting the result of getDouble()*limit_exclusive to unsigned int.
     28inline unsigned int rndUint(size_t limit_exclusive) {return rndUint((unsigned int)limit_exclusive);} //just an overload with size_t argument to avoid compiler warnings and avoid hundreds of casts. May limit the range if size_t is larger than unsigned int and somebody would intentionally use such a huge limit_exclusive value.
    2929#endif
    3030unsigned int rndUint(int limit_exclusive); //just an overload with int argument
  • cpp/frams/config/version.h

    r1305 r1318  
    33// See LICENSE.txt for details.
    44
    5 #define MAIN_REL_ID "5.0rc30"
    6 #define VERSION_INT 22
     5#define MAIN_REL_ID "5.0"
     6#define VERSION_INT 23
    77
    88
    99#ifdef IPHONE
    10         // make the version displayed in the "About" window compatible with Apple's ideas about versioning
    11         #define IOS_VERSION "5.0.5" //can't be arbitrary text as in some other platforms, so let's make it "Framsticks version (disregarding rc)" + dot + "number increased on each release"
     10        // in the "About" window, display both MAIN_REL_ID and the version compatible with Apple's ideas about versioning
     11        #define IOS_VERSION "5.0.7" //for Apple, this can't be arbitrary text (like MAIN_REL_ID could be) as in some other platforms, so let's make it "Framsticks version (disregarding "rc", "beta" etc.)" + dot + "number increased on each release"
    1212        #define VERSION_FOR_MOBI_ABOUT IOS_VERSION "<br><small>(Framsticks " MAIN_REL_ID ")</small>" //...but still display the true internal Framsticks version
    1313#else
  • cpp/frams/model/modelparts.h

    r1302 r1318  
    9999        enum Shape {
    100100                SHAPE_BALL = 0, ///<  for "ball and stick" shape type model only.
    101                 SHAPE_ELLIPSOID = 1, SHAPE_CUBOID = 2, SHAPE_CYLINDER = 3,
     101                SHAPE_ELLIPSOID = 1, SHAPE_CUBOID = 2 /* rectangular cuboid */, SHAPE_CYLINDER = 3,
    102102                SHAPE_FIRST = SHAPE_BALL, SHAPE_LAST = SHAPE_CYLINDER // for iteration
    103103        };
    104104        static const char* getShapeName(Shape sh);
    105         static constexpr double DEFAULT_STICK_RADIUS = 0.15; //used in odesim and in SHAPETYPE_BALL_AND_STICK to SHAPETYPE_SOLIDS Model conversion
     105        static constexpr double DEFAULT_STICK_RADIUS = 0.15; //used in odesim, VisualModel, CreatureObj3D, and SHAPETYPE_BALL_AND_STICK to SHAPETYPE_SOLIDS Model conversion
    106106
    107107        double mass, size, density, friction, ingest, assim, hollow;
Note: See TracChangeset for help on using the changeset viewer.