Skip to content

Commit

Permalink
Support C functions should be static
Browse files Browse the repository at this point in the history
  • Loading branch information
timj committed Aug 8, 2014
1 parent cc5e843 commit 1ca9e83
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lib/Starlink/AST.xs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ typedef void AstTimeMap;
#include "arrays.h"
#include "astTypemap.h"

char ** pack1Dchar( AV * avref ) {
static char ** pack1Dchar( AV * avref ) {
int i;
SV ** elem;
char ** outarr;
Expand All @@ -196,7 +196,7 @@ char ** pack1Dchar( AV * avref ) {
return outarr;
}

AstObject ** pack1DAstObj( AV * avref ) {
static AstObject ** pack1DAstObj( AV * avref ) {
int i;
SV ** elem;
AstObject ** outarr;
Expand Down Expand Up @@ -232,7 +232,7 @@ AstObject ** pack1DAstObj( AV * avref ) {
add to the complexity by calling out into perl.
*/

void astThrowException ( int status, AV* errorstack ) {
static void astThrowException ( int status, AV* errorstack ) {
size_t i;
size_t nelem;

Expand Down Expand Up @@ -410,14 +410,17 @@ AV* ErrBuff;
/* This is the error handler.
Store error messages in an array. Need to worry about thread-local storage
very soon.
This symbol must be available to the AST routines as we are deliberately
replacing the AST error handler.
*/

void astPutErr_ ( int status, const char * message ) {
/* the av_clear decrements the refcnt of the SV entries */
av_push(ErrBuff, newSVpv((char*)message, 0) );
}

void My_astClearErrMsg () {
static void My_astClearErrMsg () {
av_clear( ErrBuff );
}

Expand All @@ -431,7 +434,7 @@ void My_astClearErrMsg () {
Does not try to do anything if status is 0
*/

void My_astCopyErrMsg ( AV ** newbuff, int status ) {
static void My_astCopyErrMsg ( AV ** newbuff, int status ) {
size_t i;
size_t nelem;
if (status == 0) return;
Expand All @@ -454,8 +457,8 @@ void My_astCopyErrMsg ( AV ** newbuff, int status ) {

/* Since you can not put CPP code within CPP code inside XS we need
to provide a special wrapper routine for astRate */
void myAstRate ( AstMapping * this, double * cat, int ax1, int ax2,
double * d2) {
static void myAstRate ( AstMapping * this, double * cat, int ax1, int ax2,
double * d2) {
double RETVAL;
dXSARGS;

Expand Down

0 comments on commit 1ca9e83

Please sign in to comment.