@@ -621,88 +621,6 @@ static inline uint64_t int64_safe_unsigned_abs(int64_t i64)
621621 return (i64 < 0 ) ? ((uint64_t ) - (i64 + 1 )) + 1 : (uint64_t ) i64 ;
622622}
623623
624- /**
625- * @brief Check if 32-bit signed integer (\c int32_t) is negative
626- *
627- * Efficient predicate to test if a 32-bit signed integer is negative,
628- * equivalent to \c (i32 < 0).
629- *
630- * @param i32 Signed 32-bit integer to test
631- * @return true if negative, false if zero or positive
632- */
633- static inline bool int32_is_negative (int32_t i32 )
634- {
635- return ((uint32_t ) i32 ) >> 31 ;
636- }
637-
638- /**
639- * @brief Check if 64-bit signed integer (\c int64_t) is negative
640- *
641- * Efficient predicate to test if a 64-bit signed integer is negative,
642- * equivalent to (i64 < 0).
643- *
644- * @param i64 Signed 64-bit integer to test
645- * @return true if negative, false if zero or positive
646- */
647- static inline bool int64_is_negative (int64_t i64 )
648- {
649- return ((uint64_t ) i64 ) >> 63 ;
650- }
651-
652- /**
653- * @brief Get absolute value as uint32_t and sign of 32-bit integer
654- *
655- * Computes the absolute value of a signed 32-bit integer (\c int32_t) as
656- * unsigned (\c uint32_t) and sets a flag indicating whether the original
657- * value was negative. Combines sign extraction and absolute value computation
658- * for efficiency. Commonly used when serializing integers where the sign is
659- * stored separately from the magnitude.
660- *
661- * @param i32 Signed integer to process
662- * @param[out] is_negative Set to true if i32 is negative, false otherwise
663- * @return Absolute value as unsigned 32-bit integer (\c uint32_t)
664- *
665- * @pre is_negative != NULL
666- *
667- * @note Useful for integer formatting and parsing operations
668- * @note Handles \c INT32_MIN correctly
669- *
670- * @see int32_safe_unsigned_abs() for absolute value without sign flag
671- * @see int32_is_negative() for sign checking only
672- */
673- static inline uint32_t int32_safe_unsigned_abs_set_flag (int32_t i32 , bool * is_negative )
674- {
675- * is_negative = int32_is_negative (i32 );
676- return int32_safe_unsigned_abs (i32 );
677- }
678-
679- /**
680- * @brief Get absolute value as uint64_t and sign of 64-bit integer
681- *
682- * Computes the absolute value of a signed 64-bit integer (\c int64_t) as
683- * unsigned (\c uint64_t) and sets a flag indicating whether the original
684- * value was negative. Combines sign extraction and absolute value computation
685- * for efficiency. Commonly used when serializing integers where the sign is
686- * stored separately from the magnitude.
687- *
688- * @param i64 Signed integer to process
689- * @param[out] is_negative Set to true if i64 is negative, false otherwise
690- * @return Absolute value as unsigned 64-bit integer (\c uint64_t)
691- *
692- * @pre is_negative != NULL
693- *
694- * @note Useful for integer formatting and parsing operations
695- * @note Handles \c INT64_MIN correctly
696- *
697- * @see int64_safe_unsigned_abs() for absolute value without sign flag
698- * @see int64_is_negative() for sign checking only
699- */
700- static inline uint64_t int64_safe_unsigned_abs_set_flag (int64_t i64 , bool * is_negative )
701- {
702- * is_negative = int64_is_negative (i64 );
703- return int64_safe_unsigned_abs (i64 );
704- }
705-
706624/**
707625 * @brief Perform arithmetic right shift on 32-bit signed integer (\c int32_t)
708626 *
0 commit comments