Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r.sun: fix -Wimplicit-int warnings #3097

Merged
merged 1 commit into from
Aug 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion raster/r.sun/local_proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void setHorizonInterval(double val);
void setAngularLossDenominator();


void cube(int, int);
/* void cube(int, int); */

double com_sol_const(int no_of_day);

Expand Down
12 changes: 6 additions & 6 deletions raster/r.sun/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ int OUTGR(void);
int min(int, int);
int max(int, int);

void cube(int, int);
void (*func) (int, int);
/* void cube(int, int);
void (*func) (int, int); */

void joules2(struct SunGeometryConstDay *sunGeom,
struct SunGeometryVarDay *sunVarGeom,
Expand Down Expand Up @@ -1685,9 +1685,9 @@ void where_is_point(double *length, struct SunGeometryVarDay *sunVarGeom,
* }
*/

void cube(jmin, imin)
/* void cube(jmin, imin)
{
}
} */


/*////////////////////////////////////////////////////////////////////// */
Expand Down Expand Up @@ -1837,7 +1837,7 @@ void calculate(double singleSlope, double singleAspect, double singleAlbedo,
}
sunVarGeom.zmax = zmax;
shadowoffset_base = (j % (numRows)) * n * arrayNumInt;
#pragma omp parallel firstprivate(q1,tan_lam_l,z1,i,shadowoffset,longitTime,coslat,coslatsq,func,latitude,longitude,sin_phi_l,latid_l,sin_u,cos_u,sin_v,cos_v,lum,gridGeom,elevin,aspin,slopein,civiltime,linkein,albedo,latin,coefbh,coefdh,incidout,longin,horizon,beam_rad,insol_time,diff_rad,refl_rad,glob_rad,mapset,per,decimals,str_step)
#pragma omp parallel firstprivate(q1,tan_lam_l,z1,i,shadowoffset,longitTime,coslat,coslatsq,latitude,longitude,sin_phi_l,latid_l,sin_u,cos_u,sin_v,cos_v,lum,gridGeom,elevin,aspin,slopein,civiltime,linkein,albedo,latin,coefbh,coefdh,incidout,longin,horizon,beam_rad,insol_time,diff_rad,refl_rad,glob_rad,mapset,per,decimals,str_step)
{
#pragma omp for schedule(dynamic) \
firstprivate(sunGeom,sunVarGeom,sunSlopeGeom,sunRadVar) \
Expand All @@ -1862,7 +1862,7 @@ void calculate(double singleSlope, double singleAspect, double singleAlbedo,
coslatsq = coslat * coslat;
}

func = NULL;
/* func = NULL; */

sunVarGeom.z_orig = z1 = sunVarGeom.zp = z[arrayOffset][i];

Expand Down
2 changes: 1 addition & 1 deletion raster/r.sun/rsunglobals.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ extern struct pj_info iproj;
extern struct pj_info oproj;


extern void (*func) (int, int);
/* extern void (*func) (int, int); */
6 changes: 3 additions & 3 deletions raster/r.sun/rsunlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,11 @@ int searching(double *length, struct SunGeometryVarDay *sunVarGeom,

if (succes == 1) {
where_is_point(length, sunVarGeom, gridGeom);
if (func == NULL) {
/*if (func == NULL) {
gridGeom->xx0 = gridGeom->xg0;
gridGeom->yy0 = gridGeom->yg0;
return (3);
}
}*/
curvature_diff = EARTHRADIUS * (1. - cos(*length / EARTHRADIUS));

z2 = sunVarGeom->z_orig + curvature_diff +
Expand Down Expand Up @@ -338,7 +338,7 @@ double lumcline2(struct SunGeometryConstDay *sungeom,
double timeoffset, horizPos;
double horizonHeight;

func = cube;
/* func = cube; */
sunVarGeom->isShadow = 0;

if (useShadow()) {
Expand Down