From: curt Date: Mon, 19 Jan 1998 18:40:33 +0000 (+0000) Subject: Tons of little changes to clean up the code and to remove fatal errors X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=61a8afa06acd54c0314ada97626a6dfdc0124f07;p=simgear.git Tons of little changes to clean up the code and to remove fatal errors when building with the c++ compiler. --- diff --git a/Math/MAT3geom.c b/Math/MAT3geom.c index fc3000e9..d07728d6 100644 --- a/Math/MAT3geom.c +++ b/Math/MAT3geom.c @@ -20,8 +20,7 @@ */ void -MAT3direction_matrix(result_mat, mat) -register MAT3mat result_mat, mat; +MAT3direction_matrix(register double (*result_mat)[4], register double (*mat)[4]) { register int i; @@ -45,8 +44,7 @@ register MAT3mat result_mat, mat; */ int -MAT3normal_matrix(result_mat, mat) -register MAT3mat result_mat, mat; +MAT3normal_matrix(register double (*result_mat)[4], register double (*mat)[4]) { register int ret; MAT3mat tmp_mat; @@ -66,9 +64,7 @@ register MAT3mat result_mat, mat; */ void -MAT3scale(result_mat, scale) -MAT3mat result_mat; -MAT3vec scale; +MAT3scale(double (*result_mat)[4], double *scale) { MAT3identity(result_mat); @@ -86,10 +82,7 @@ MAT3vec scale; #define SELECT .7071 /* selection constant (roughly .5*sqrt(2) */ void -MAT3rotate(result_mat, axis, angle_in_radians) -MAT3mat result_mat; -MAT3vec axis; -double angle_in_radians; +MAT3rotate(double (*result_mat)[4], double *axis, double angle_in_radians) { MAT3vec naxis, /* Axis of rotation, normalized */ base2, /* 2nd unit basis vec, perp to axis */ @@ -150,9 +143,7 @@ double angle_in_radians; */ void -MAT3translate(result_mat, trans) -MAT3mat result_mat; -MAT3vec trans; +MAT3translate(double (*result_mat)[4], double *trans) { MAT3identity(result_mat); @@ -167,9 +158,7 @@ MAT3vec trans; */ void -MAT3shear(result_mat, xshear, yshear) -MAT3mat result_mat; -double xshear, yshear; +MAT3shear(double (*result_mat)[4], double xshear, double yshear) { MAT3identity(result_mat); diff --git a/Math/MAT3inv.c b/Math/MAT3inv.c index f5e72a30..b787b8b7 100644 --- a/Math/MAT3inv.c +++ b/Math/MAT3inv.c @@ -260,8 +260,7 @@ MAT3_inv4_pivot (register MAT3mat src, MAT3vec r, double *s, int *swap) */ int -MAT3invert(result_mat, mat) -MAT3mat result_mat, mat; +MAT3invert(double (*result_mat)[4], double (*mat)[4]) { MAT3mat src, inv; register int i, j, simple; diff --git a/Math/MAT3mat.c b/Math/MAT3mat.c index 02518afb..5c74e01b 100644 --- a/Math/MAT3mat.c +++ b/Math/MAT3mat.c @@ -75,9 +75,7 @@ MAT3copy(MAT3mat to, MAT3mat from) */ void -MAT3mult (result_mat, mat1, mat2) -MAT3mat result_mat; -register MAT3mat mat1, mat2; +MAT3mult (double (*result_mat)[4], register double (*mat1)[4], register double (*mat2)[4]) { register int i, j; MAT3mat tmp_mat; @@ -97,9 +95,7 @@ register MAT3mat mat1, mat2; */ void -MAT3transpose (result_mat, mat) -MAT3mat result_mat; -register MAT3mat mat; +MAT3transpose (double (*result_mat)[4], register double (*mat)[4]) { register int i, j; MAT3mat tmp_mat; @@ -117,9 +113,7 @@ register MAT3mat mat; */ void -MAT3print(mat, fp) -MAT3mat mat; -FILE *fp; +MAT3print(double (*mat)[4], FILE *fp) { MAT3print_formatted(mat, fp, CNULL, CNULL, CNULL, CNULL); } @@ -131,10 +125,7 @@ FILE *fp; */ void -MAT3print_formatted(mat, fp, title, head, format, tail) -MAT3mat mat; -FILE *fp; -char *title, *head, *format, *tail; +MAT3print_formatted(double (*mat)[4], FILE *fp, char *title, char *head, char *format, char *tail) { register int i, j; diff --git a/Math/MAT3vec.c b/Math/MAT3vec.c index 9e71042b..a971ebe1 100644 --- a/Math/MAT3vec.c +++ b/Math/MAT3vec.c @@ -31,10 +31,7 @@ void -MAT3mult_vec(result_vec, vec, mat) -MAT3vec result_vec; -register MAT3vec vec; -register MAT3mat mat; +MAT3mult_vec(double *result_vec, register double *vec, register double (*mat)[4]) { MAT3vec tempvec; register double *temp = tempvec; @@ -59,10 +56,7 @@ register MAT3mat mat; */ int -MAT3mult_hvec(result_vec, vec, mat, normalize) -MAT3hvec result_vec; -register MAT3hvec vec; -register MAT3mat mat; +MAT3mult_hvec(double *result_vec, register double *vec, register double (*mat)[4], int normalize) { MAT3hvec tempvec; double norm_fac; @@ -103,9 +97,7 @@ register MAT3mat mat; */ void -MAT3cross_product(result_vec, vec1, vec2) -MAT3vec result_vec; -register MAT3vec vec1, vec2; +MAT3cross_product(double *result_vec, register double *vec1, register double *vec2) { MAT3vec tempvec; register double *temp = tempvec; @@ -129,9 +121,7 @@ register MAT3vec vec1, vec2; #define SELECT .7071 /* selection constant (roughly .5*sqrt(2) */ void -MAT3perp_vec(result_vec, vec, is_unit) -MAT3vec result_vec, vec; -int is_unit; +MAT3perp_vec(double *result_vec, double *vec, int is_unit) { MAT3vec norm; double dot; diff --git a/Math/depend b/Math/depend index c8226d59..c6605e20 100644 --- a/Math/depend +++ b/Math/depend @@ -4,6 +4,5 @@ MAT3mat.o: MAT3mat.c mat3defs.h mat3.h MAT3vec.o: MAT3vec.c mat3.h fg_geodesy.o: fg_geodesy.c fg_geodesy.h ../Include/constants.h fg_random.o: fg_random.c fg_random.h -geotest.o: geotest.c ../Include/constants.h fg_geodesy.h polar.o: polar.c polar.h ../Include/types.h ../Include/constants.h vector.o: vector.c vector.h ../Math/mat3.h diff --git a/Math/mat3.h b/Math/mat3.h index cc7b54d8..58c4b9e0 100644 --- a/Math/mat3.h +++ b/Math/mat3.h @@ -131,11 +131,11 @@ int MAT3invert (MAT3mat result, MAT3mat); void MAT3print (MAT3mat, FILE *fp); void MAT3print_formatted (MAT3mat, FILE *fp, char *title, char *head, char *format, char *tail); -extern int MAT3equal(); -extern double MAT3trace(); -extern int MAT3power(); -extern int MAT3column_reduce(); -extern int MAT3kernel_basis(); +extern int MAT3equal( void ); +extern double MAT3trace( void ); +extern int MAT3power( void ); +extern int MAT3column_reduce( void ); +extern int MAT3kernel_basis( void ); /* In MAT3vec.c */ void MAT3mult_vec(MAT3vec result_vec, MAT3vec vec, MAT3mat mat);