Skip to content

Declare functions static #128

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

Merged
merged 1 commit into from
May 21, 2024
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
4 changes: 2 additions & 2 deletions contrib/Shape_PointInPoly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ struct IntersectPoint
loopDir loopdirection;
};

loopDir LoopDirection(DPoint2d *vertices, int vertsize)
static loopDir LoopDirection(DPoint2d *vertices, int vertsize)
{
int i;
double sum = 0.0;
Expand All @@ -70,7 +70,7 @@ loopDir LoopDirection(DPoint2d *vertices, int vertsize)
return kExterior;
}

DPoint2d CreatePointInPoly(SHPObject *psShape, int quality)
static DPoint2d CreatePointInPoly(SHPObject *psShape, int quality)
{
int i, j, k, end, vert, pointpos;
double part, dx, xmin, xmax, ymin, ymax, y, x3, x4, y3, y4, len, maxlen = 0;
Expand Down
14 changes: 7 additions & 7 deletions contrib/csv2shp.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ typedef struct column_t
} column;

/* counts the number of occurrences of the character in the string */
int strnchr(const char *s, char c)
static int strnchr(const char *s, char c)
{
int n = 0;

Expand All @@ -103,7 +103,7 @@ int strnchr(const char *s, char c)

/* Returns a field given by column n (0-based) in a character-
delimited string s */
char *delimited_column(const char *s, char delim, int n)
static char *delimited_column(const char *s, char delim, int n)
{
if (strnchr(s, delim) < n)
{
Expand Down Expand Up @@ -137,7 +137,7 @@ char *delimited_column(const char *s, char delim, int n)
}

/* returns the number of decimals in a real number given as a string s */
int str_to_ndecimals(const char *s)
static int str_to_ndecimals(const char *s)
{
if (s == NULL)
{
Expand Down Expand Up @@ -175,7 +175,7 @@ int str_to_ndecimals(const char *s)

/* Determines the most specific column type.
The most specific types from most to least are integer, float, string. */
DBFFieldType str_to_fieldtype(const char *s)
static DBFFieldType str_to_fieldtype(const char *s)
{
size_t len = strlen(s);

Expand All @@ -198,7 +198,7 @@ DBFFieldType str_to_fieldtype(const char *s)
}

/* returns the field width */
int str_to_nwidth(const char *s, DBFFieldType eType)
static int str_to_nwidth(const char *s, DBFFieldType eType)
{
switch (eType)
{
Expand All @@ -214,7 +214,7 @@ int str_to_nwidth(const char *s, DBFFieldType eType)
}

/* returns true if f1 is more general than f2, otherwise false */
int more_general_field_type(DBFFieldType t1, DBFFieldType t2)
static int more_general_field_type(DBFFieldType t1, DBFFieldType t2)
{
if (FTInteger == t2 && t1 != FTInteger)
{
Expand All @@ -229,7 +229,7 @@ int more_general_field_type(DBFFieldType t1, DBFFieldType t2)
return 0;
}

void strip_crlf(const char *line)
static void strip_crlf(const char *line)
{
/* remove trailing CR/LF */

Expand Down
2 changes: 1 addition & 1 deletion shprewind.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ int main(int argc, char **argv)
}

/* -------------------------------------------------------------------- */
/* Skim over the list of shapes, printing all the vertices. */
/* Skim over the list of shapes, printing all the vertices. */
/* -------------------------------------------------------------------- */
int nInvalidCount = 0;

Expand Down