Добавление объявлений для inline методов в единицах трансляции в соответствии со стандартом C99

This commit is contained in:
Andrey Pokidov 2025-02-03 23:34:01 +07:00
parent e39765b733
commit 6c0ae92ed4
14 changed files with 646 additions and 1 deletions

View file

@ -1,3 +1,67 @@
#include "utilities.h"
#include "angle.h"
// !================= Radians ==================! //
extern inline float bgc_radians_to_degrees_fp32(const float radians);
extern inline double bgc_radians_to_degrees_fp64(const double radians);
extern inline float bgc_radians_to_turns_fp32(const float radians);
extern inline double bgc_radians_to_turns_fp64(const double radians);
extern inline float bgc_radians_to_units_fp32(const float radians, const BgcAngleUnitEnum to_unit);
extern inline double bgc_radians_to_units_fp64(const double radians, const BgcAngleUnitEnum to_unit);
extern inline float bgc_radians_normalize_fp32(const float radians, const BgcAngleRangeEnum range);
extern inline double bgc_radians_normalize_fp64(const double radians, const BgcAngleRangeEnum range);
// !================= Degrees ==================! //
extern inline float bgc_degrees_to_radians_fp32(const float degrees);
extern inline double bgc_degrees_to_radians_fp64(const double degrees);
extern inline float bgc_degrees_to_turns_fp32(const float radians);
extern inline double bgc_degrees_to_turns_fp64(const double radians);
extern inline float bgc_degrees_to_units_fp32(const float degrees, const BgcAngleUnitEnum to_unit);
extern inline double bgc_degrees_to_units_fp64(const double degrees, const BgcAngleUnitEnum to_unit);
extern inline float bgc_degrees_normalize_fp32(const float degrees, const BgcAngleRangeEnum range);
extern inline double bgc_degrees_normalize_fp64(const double degrees, const BgcAngleRangeEnum range);
// !================== Turns ===================! //
extern inline float bgc_turns_to_radians_fp32(const float turns);
extern inline double bgc_turns_to_radians_fp64(const double turns);
extern inline float bgc_turns_to_degrees_fp32(const float turns);
extern inline double bgc_turns_to_degrees_fp64(const double turns);
extern inline float bgc_turns_to_units_fp32(const float turns, const BgcAngleUnitEnum to_unit);
extern inline double bgc_turns_to_units_fp64(const double turns, const BgcAngleUnitEnum to_unit);
extern inline float bgc_turns_normalize_fp32(const float turns, const BgcAngleRangeEnum range);
extern inline double bgc_turns_normalize_fp64(const double turns, const BgcAngleRangeEnum range);
// !================== Angle ===================! //
extern inline float bgc_angle_to_radians_fp32(const float angle, const BgcAngleUnitEnum unit);
extern inline double bgc_angle_to_radians_fp64(const double angle, const BgcAngleUnitEnum unit);
extern inline float bgc_angle_to_degrees_fp32(const float angle, const BgcAngleUnitEnum unit);
extern inline double bgc_angle_to_degrees_fp64(const double angle, const BgcAngleUnitEnum unit);
extern inline float bgc_angle_to_turns_fp32(const float angle, const BgcAngleUnitEnum unit);
extern inline double bgc_angle_to_turns_fp64(const double angle, const BgcAngleUnitEnum unit);
extern inline float bgc_angle_get_full_circle_fp32(const BgcAngleUnitEnum unit);
extern inline double bgc_angle_get_full_circle_fp64(const BgcAngleUnitEnum unit);
extern inline float bgc_angle_get_half_circle_fp32(const BgcAngleUnitEnum unit);
extern inline double bgc_angle_get_half_circle_fp64(const BgcAngleUnitEnum unit);
extern inline float bgc_angle_get_quater_circle_fp32(const BgcAngleUnitEnum unit);
extern inline double bgc_angle_get_quater_circle_fp64(const BgcAngleUnitEnum unit);
extern inline float bgc_angle_normalize_fp32(const float angle, const BgcAngleUnitEnum unit, const BgcAngleRangeEnum range);
extern inline double bgc_angle_normalize_fp64(const double angle, const BgcAngleUnitEnum unit, const BgcAngleRangeEnum range);

View file

@ -173,7 +173,7 @@ inline float bgc_degrees_to_turns_fp32(const float radians)
return radians * BGC_TURNS_IN_DEGREE_FP32;
}
inline double fp64_degrees_to_turns(const double radians)
inline double bgc_degrees_to_turns_fp64(const double radians)
{
return radians * BGC_TURNS_IN_DEGREE_FP64;
}

View file

Internal server error - Personal Git Server: Beyond coding. We Forge.

500

Internal server error

Forgejo version: 11.0.1+gitea-1.22.0

@ -1 +1,73 @@
#include "matrix2x2.h"
extern inline void bgc_matrix2x2_reset_fp32(BgcMatrix2x2FP32* matrix);
extern inline void bgc_matrix2x2_reset_fp64(BgcMatrix2x2FP64* matrix);
extern inline void bgc_matrix2x2_set_to_identity_fp32(BgcMatrix2x2FP32* matrix);
extern inline void bgc_matrix2x2_set_to_identity_fp64(BgcMatrix2x2FP64* matrix);
extern inline void bgc_matrix2x2_set_to_diagonal_fp32(const float d1, const float d2, BgcMatrix2x2FP32* matrix);
extern inline void bgc_matrix2x2_set_to_diagonal_fp64(const double d1, const double d2, BgcMatrix2x2FP64* matrix);
extern inline void bgc_matrix2x2_make_rotation_fp32(const float angle, const BgcAngleUnitEnum unit, BgcMatrix2x2FP32* matrix);
extern inline void bgc_matrix2x2_make_rotation_fp64(const double angle, const BgcAngleUnitEnum unit, BgcMatrix2x2FP64* matrix);
extern inline void bgc_matrix2x2_copy_fp32(const BgcMatrix2x2FP32* from, BgcMatrix2x2FP32* to);
extern inline void bgc_matrix2x2_copy_fp64(const BgcMatrix2x2FP64* from, BgcMatrix2x2FP64* to);
extern inline void bgc_matrix2x2_swap_fp32(BgcMatrix2x2FP32* matrix1, BgcMatrix2x2FP32* matrix2);
extern inline void bgc_matrix2x2_swap_fp64(BgcMatrix2x2FP64* matrix1, BgcMatrix2x2FP64* matrix2);
extern inline void bgc_matrix2x2_convert_fp64_to_fp32(const BgcMatrix2x2FP64* from, BgcMatrix2x2FP32* to);
extern inline void bgc_matrix2x2_convert_fp32_to_fp64(const BgcMatrix2x2FP32* from, BgcMatrix2x2FP64* to);
extern inline float bgc_matrix2x2_get_determinant_fp32(const BgcMatrix2x2FP32* matrix);
extern inline double bgc_matrix2x2_get_determinant_fp64(const BgcMatrix2x2FP64* matrix);
extern inline int bgc_matrix2x2_is_singular_fp32(const BgcMatrix2x2FP32* matrix);
extern inline int bgc_matrix2x2_is_singular_fp64(const BgcMatrix2x2FP64* matrix);
extern inline void bgc_matrix2x2_transpose_fp32(BgcMatrix2x2FP32* matrix);
extern inline void bgc_matrix2x2_transpose_fp64(BgcMatrix2x2FP64* matrix);
extern inline int bgc_matrix2x2_invert_fp32(BgcMatrix2x2FP32* matrix);
extern inline int bgc_matrix2x2_invert_fp64(BgcMatrix2x2FP64* matrix);
extern inline void bgc_matrix2x2_set_transposed_fp32(const BgcMatrix2x2FP32* from, BgcMatrix2x2FP32* to);
extern inline void bgc_matrix2x2_set_transposed_fp64(const BgcMatrix2x2FP64* from, BgcMatrix2x2FP64* to);
extern inline int bgc_matrix2x2_set_inverted_fp32(const BgcMatrix2x2FP32* from, BgcMatrix2x2FP32* to);