Skip to content
This repository has been archived by the owner on Dec 31, 2018. It is now read-only.

Commit

Permalink
C99-isms removed from header files.
Browse files Browse the repository at this point in the history
In this way, one is not forced to use a C99 compiler to use HPixLib (although to compile the library itself you need it, sure you do!).
  • Loading branch information
ziotom78 committed Jun 21, 2013
1 parent 5586d8a commit 61b1efa
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 48 deletions.
20 changes: 10 additions & 10 deletions src/bitmap.c
Expand Up @@ -21,14 +21,14 @@
#include <math.h>
#include <assert.h>

typedef _Bool inside_test_t (const hpix_bmp_projection_t * proj,
unsigned int x,
unsigned int y);
typedef _Bool xy_to_angles_t (const hpix_bmp_projection_t * proj,
unsigned int x,
unsigned int y,
double * theta,
double * phi);
typedef int inside_test_t (const hpix_bmp_projection_t * proj,
unsigned int x,
unsigned int y);
typedef int xy_to_angles_t (const hpix_bmp_projection_t * proj,
unsigned int x,
unsigned int y,
double * theta,
double * phi);

struct ___hpix_bmp_projection_t {
unsigned int width;
Expand Down Expand Up @@ -129,7 +129,7 @@ hpix_set_mollweide_projection(hpix_bmp_projection_t * proj)

/**********************************************************************/

_Bool
int
hpix_bmp_projection_is_xy_inside(const hpix_bmp_projection_t * proj,
unsigned int x,
unsigned int y)
Expand All @@ -143,7 +143,7 @@ hpix_bmp_projection_is_xy_inside(const hpix_bmp_projection_t * proj,
/**********************************************************************/


_Bool
int
hpix_bmp_projection_xy_to_angles(const hpix_bmp_projection_t * proj,
unsigned int x,
unsigned int y,
Expand Down
4 changes: 2 additions & 2 deletions src/equirectangular_projection.c
Expand Up @@ -27,7 +27,7 @@
/**********************************************************************/


_Bool
int
hpix_equirectangular_is_xy_inside(const hpix_bmp_projection_t * proj,
unsigned int x,
unsigned int y)
Expand All @@ -39,7 +39,7 @@ hpix_equirectangular_is_xy_inside(const hpix_bmp_projection_t * proj,
/**********************************************************************/


_Bool
int
hpix_equirectangular_xy_to_angles(const hpix_bmp_projection_t * proj,
unsigned int x,
unsigned int y,
Expand Down
60 changes: 30 additions & 30 deletions src/hpixlib/hpix.h
Expand Up @@ -64,7 +64,7 @@ typedef struct {
hpix_ordering_scheme_t scheme;
hpix_coordinates_t coord;
double * pixels;
_Bool free_pixels_flag;
int free_pixels_flag;

hpix_resolution_t resolution;
} hpix_map_t;
Expand Down Expand Up @@ -119,7 +119,7 @@ void hpix_free(void * ptr);

/* Functions implemented in misc.c */

_Bool hpix_valid_nside(hpix_nside_t nside);
int hpix_valid_nside(hpix_nside_t nside);
hpix_pixel_num_t hpix_nside_to_npixel(hpix_nside_t);
hpix_nside_t hpix_npixel_to_nside(hpix_pixel_num_t);
double hpix_max_pixel_radius(hpix_nside_t);
Expand Down Expand Up @@ -293,14 +293,14 @@ hpix_set_bmp_projection_height(hpix_bmp_projection_t * proj,
hpix_projection_type_t hpix_bmp_projection_type(const hpix_bmp_projection_t * proj);
void hpix_set_equirectangular_projection(hpix_bmp_projection_t * proj);
void hpix_set_mollweide_projection(hpix_bmp_projection_t * proj);
_Bool hpix_bmp_projection_is_xy_inside(const hpix_bmp_projection_t * proj,
unsigned int x,
unsigned int y);
_Bool hpix_bmp_projection_xy_to_angles(const hpix_bmp_projection_t * proj,
unsigned int x,
unsigned int y,
double * theta,
double * phi);
int hpix_bmp_projection_is_xy_inside(const hpix_bmp_projection_t * proj,
unsigned int x,
unsigned int y);
int hpix_bmp_projection_xy_to_angles(const hpix_bmp_projection_t * proj,
unsigned int x,
unsigned int y,
double * theta,
double * phi);
double *
hpix_bmp_projection_trace(const hpix_bmp_projection_t * proj,
const hpix_map_t * map,
Expand Down Expand Up @@ -379,44 +379,44 @@ void hpix_set_matrix_to_scale_transform(hpix_matrix_t * matrix,
double scale_y,
double scale_z);

_Bool hpix_is_matrix_zero(const hpix_matrix_t * matrix);
int hpix_is_matrix_zero(const hpix_matrix_t * matrix);
void hpix_print_matrix(FILE * output_file,
const hpix_matrix_t * matrix,
unsigned int num_of_indents,
_Bool indent_first_line);
int indent_first_line);
void hpix_matrix_vector_mul(hpix_vector_t * result,
const hpix_matrix_t * matrix,
const hpix_vector_t * vector);
void hpix_matrix_mul(hpix_matrix_t * result,
const hpix_matrix_t * matrix1,
const hpix_matrix_t * matrix2);
double hpix_matrix_determinant(const hpix_matrix_t * matrix);
_Bool hpix_matrix_inverse(hpix_matrix_t * result,
const hpix_matrix_t * matrix);
int hpix_matrix_inverse(hpix_matrix_t * result,
const hpix_matrix_t * matrix);

/* Functions implemented in equirectangular_projection.c */

_Bool hpix_equirectangular_is_xy_inside(const hpix_bmp_projection_t * proj,
unsigned int x,
unsigned int y);
int hpix_equirectangular_is_xy_inside(const hpix_bmp_projection_t * proj,
unsigned int x,
unsigned int y);

_Bool hpix_equirectangular_xy_to_angles(const hpix_bmp_projection_t * proj,
unsigned int x,
unsigned int y,
double * theta,
double * phi);
int hpix_equirectangular_xy_to_angles(const hpix_bmp_projection_t * proj,
unsigned int x,
unsigned int y,
double * theta,
double * phi);

/* Functions implemented in mollweide_projection.c */

_Bool hpix_mollweide_is_xy_inside(const hpix_bmp_projection_t * proj,
unsigned int x,
unsigned int y);
int hpix_mollweide_is_xy_inside(const hpix_bmp_projection_t * proj,
unsigned int x,
unsigned int y);

_Bool hpix_mollweide_xy_to_angles(const hpix_bmp_projection_t * proj,
unsigned int x,
unsigned int y,
double * theta,
double * phi);
int hpix_mollweide_xy_to_angles(const hpix_bmp_projection_t * proj,
unsigned int x,
unsigned int y,
double * theta,
double * phi);

/* Functions implemented in query_disc.c */

Expand Down
6 changes: 3 additions & 3 deletions src/matrices.c
Expand Up @@ -67,7 +67,7 @@ hpix_set_matrix_to_scale_transform(hpix_matrix_t * matrix,
/**********************************************************************/


_Bool
int
hpix_is_matrix_zero(const hpix_matrix_t * matrix)
{
assert(matrix);
Expand All @@ -85,7 +85,7 @@ void
hpix_print_matrix(FILE * output_file,
const hpix_matrix_t * matrix,
unsigned int num_of_indents,
_Bool indent_first_line)
int indent_first_line)
{
assert(output_file);
assert(matrix);
Expand Down Expand Up @@ -206,7 +206,7 @@ hpix_matrix_determinant(const hpix_matrix_t * matrix)
/**********************************************************************/


_Bool
int
hpix_matrix_inverse(hpix_matrix_t * result,
const hpix_matrix_t * matrix)
{
Expand Down
2 changes: 1 addition & 1 deletion src/misc.c
Expand Up @@ -20,7 +20,7 @@
#include <hpixlib/hpix.h>
#include <math.h>

_Bool
int
hpix_valid_nside(hpix_nside_t nside)
{
return nside > 0 && (! (nside & (nside - 1)));
Expand Down
4 changes: 2 additions & 2 deletions src/mollweide_projection.c
Expand Up @@ -61,7 +61,7 @@ mollweide_is_uv_inside(double u, double v)
/**********************************************************************/


_Bool
int
hpix_mollweide_is_xy_inside(const hpix_bmp_projection_t * proj,
unsigned int x,
unsigned int y)
Expand All @@ -75,7 +75,7 @@ hpix_mollweide_is_xy_inside(const hpix_bmp_projection_t * proj,
/**********************************************************************/


_Bool
int
hpix_mollweide_xy_to_angles(const hpix_bmp_projection_t * proj,
unsigned int x,
unsigned int y,
Expand Down

0 comments on commit 61b1efa

Please sign in to comment.