Skip to content

Conversation

Copy link

Copilot AI commented Jan 12, 2026

Corrected type inconsistencies in PhobosMath wrapper functions where return types didn't match parameter types, and fixed several syntax errors preventing compilation.

Changes

Return type corrections:

  • Functions with double parameters (cosd, sind, sqrtd) now return double instead of float
  • Functions with float parameters (all *f variants) now return float instead of double

Calling convention standardization:

  • Changed asinf, atanf, atan2f from __stdcall to __cdecl for consistency

Syntax error fixes:

  • Hooks.Otamaa.cpp:7429 - Fixed malformed Math::sqrt call missing opening parenthesis
  • CircleDifferentiator.cpp:6,9 - Removed extraneous closing parentheses

Example

// Before
static float __cdecl cosd(double a1) { return (float)std::cos(a1); }
static double __stdcall asinf(float a1) { return std::asin(a1); }

// After  
static double __cdecl cosd(double a1) { return std::cos(a1); }
static float __cdecl asinf(float a1) { return (float)std::asin(a1); }
Original prompt

check all math functions in this repo, do fix and corrections


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

- Fixed return types for double-parameter functions (cosd, sind, sqrtd) to return double
- Fixed return types for float-parameter functions to return float instead of double
- Fixed calling convention inconsistencies (changed __stdcall to __cdecl)
- Fixed syntax error in Hooks.Otamaa.cpp (missing opening parenthesis in sqrt call)
- Fixed syntax errors in CircleDifferentiator.cpp (extra closing parentheses)

Co-authored-by: deathreaperz <37824218+deathreaperz@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix and correct math functions in repository Fix math function return types and calling conventions Jan 12, 2026
Copilot AI requested a review from deathreaperz January 12, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants