Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
141b7a94
Commit
141b7a94
authored
9 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Const parameters in the unit system
parent
13e73e83
No related branches found
No related tags found
1 merge request
!143
Gravity particles
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/units.c
+4
-4
4 additions, 4 deletions
src/units.c
src/units.h
+4
-4
4 additions, 4 deletions
src/units.h
with
8 additions
and
8 deletions
src/units.c
+
4
−
4
View file @
141b7a94
...
...
@@ -330,7 +330,7 @@ void units_conversion_string(char* buffer, const struct UnitSystem* us,
* the desired quantity. See conversionFactor() for a working example
*/
double
units_general_conversion_factor
(
const
struct
UnitSystem
*
us
,
float
baseUnitsExponants
[
5
])
{
const
float
baseUnitsExponants
[
5
])
{
double
factor
=
1
.;
int
i
;
...
...
@@ -348,7 +348,7 @@ double units_general_conversion_factor(const struct UnitSystem* us,
* the desired quantity. See conversionFactor() for a working example
*/
float
units_general_h_factor
(
const
struct
UnitSystem
*
us
,
float
baseUnitsExponants
[
5
])
{
const
float
baseUnitsExponants
[
5
])
{
float
factor_exp
=
0
.
f
;
factor_exp
+=
-
baseUnitsExponants
[
UNIT_MASS
];
...
...
@@ -366,7 +366,7 @@ float units_general_h_factor(const struct UnitSystem* us,
* the desired quantity. See conversionFactor() for a working example
*/
float
units_general_a_factor
(
const
struct
UnitSystem
*
us
,
float
baseUnitsExponants
[
5
])
{
const
float
baseUnitsExponants
[
5
])
{
float
factor_exp
=
0
.
f
;
factor_exp
+=
baseUnitsExponants
[
UNIT_LENGTH
];
...
...
@@ -384,7 +384,7 @@ float units_general_a_factor(const struct UnitSystem* us,
* the desired quantity. See conversionFactor() for a working example
*/
void
units_general_conversion_string
(
char
*
buffer
,
const
struct
UnitSystem
*
us
,
float
baseUnitsExponants
[
5
])
{
const
float
baseUnitsExponants
[
5
])
{
char
temp
[
14
];
double
a_exp
=
units_general_a_factor
(
us
,
baseUnitsExponants
);
double
h_exp
=
units_general_h_factor
(
us
,
baseUnitsExponants
);
...
...
This diff is collapsed.
Click to expand it.
src/units.h
+
4
−
4
View file @
141b7a94
...
...
@@ -97,19 +97,19 @@ double units_get_base_unit(const struct UnitSystem*, enum BaseUnits);
const
char
*
units_get_base_unit_symbol
(
enum
BaseUnits
);
const
char
*
units_get_base_unit_CGS_symbol
(
enum
BaseUnits
);
double
units_general_conversion_factor
(
const
struct
UnitSystem
*
us
,
float
baseUnitsExponants
[
5
]);
const
float
baseUnitsExponants
[
5
]);
double
units_conversion_factor
(
const
struct
UnitSystem
*
us
,
enum
UnitConversionFactor
unit
);
float
units_general_h_factor
(
const
struct
UnitSystem
*
us
,
float
baseUnitsExponants
[
5
]);
const
float
baseUnitsExponants
[
5
]);
float
units_h_factor
(
const
struct
UnitSystem
*
us
,
enum
UnitConversionFactor
unit
);
float
units_general_a_factor
(
const
struct
UnitSystem
*
us
,
float
baseUnitsExponants
[
5
]);
const
float
baseUnitsExponants
[
5
]);
float
units_a_factor
(
const
struct
UnitSystem
*
us
,
enum
UnitConversionFactor
unit
);
void
units_general_conversion_string
(
char
*
buffer
,
const
struct
UnitSystem
*
us
,
float
baseUnitsExponants
[
5
]);
const
float
baseUnitsExponants
[
5
]);
void
units_conversion_string
(
char
*
buffer
,
const
struct
UnitSystem
*
us
,
enum
UnitConversionFactor
unit
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment