Skip to content

Commit

Permalink
Symbol renaming in molfile_plugin and internal linkage
Browse files Browse the repository at this point in the history
Fixes #395
  • Loading branch information
JarrettSJohnson committed Sep 5, 2024
1 parent d82b626 commit 9d3061c
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 12 deletions.
10 changes: 5 additions & 5 deletions contrib/uiuc/plugins/molfile_plugin/src/ReadPARM7.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
#endif


typedef struct parm {
typedef struct parm7 {
char title[85];
char version[85];
int IfBox, Nmxrs, IfCap,
Expand All @@ -70,7 +70,7 @@ typedef struct parm {
Ipatm, Natcap,Ifpert,Nbper,Ngper,Ndper,Mbper,Mgper,Mdper,
Numextra;
_REAL Box[3], Cutcap, Xcap, Ycap, Zcap;
} parmstruct;
} parm7struct;

static int read_parm7_flag(FILE *file, const char *flag, const char *format) {
char buf[1024];
Expand Down Expand Up @@ -359,10 +359,10 @@ static void close_parm7_file(FILE *fileptr, int popn) {

static const char *parm7 = "%8d%8d%8d%8d%8d%8d%8d%8d%8d%8d\n";

static parmstruct *read_parm7_header(FILE *file) {
static parm7struct *read_parm7_header(FILE *file) {
char sdum[512];
parmstruct *prm;
prm = new parmstruct;
parm7struct *prm;
prm = new parm7struct;

/* READ VERSION */
fgets(sdum, 512, file);
Expand Down
8 changes: 5 additions & 3 deletions contrib/uiuc/plugins/molfile_plugin/src/parm7plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@
#include "molfile_plugin.h"
#include "ReadPARM7.h"

namespace {
typedef struct {
parmstruct *prm;
parm7struct *prm;
int popn;
FILE *fd;
int nbonds;
int *from, *to;
} parmdata;
}

static void *open_parm7_read(const char *filename, const char *,int *natoms) {
FILE *fd;
Expand All @@ -39,7 +41,7 @@ static void *open_parm7_read(const char *filename, const char *,int *natoms) {
fprintf(stderr, "parm7plugin) Cannot open parm file '%s'\n", filename);
return NULL;
}
parmstruct *prm = read_parm7_header(fd);
parm7struct *prm = read_parm7_header(fd);
if (!prm) {
close_parm7_file(fd, popn);
return NULL;
Expand All @@ -58,7 +60,7 @@ static void *open_parm7_read(const char *filename, const char *,int *natoms) {

static int read_parm7_structure(void *mydata, int *optflags, molfile_atom_t *atoms) {
parmdata *p = (parmdata *)mydata;
const parmstruct *prm = p->prm;
const parm7struct *prm = p->prm;
FILE *file = p->fd;
char buf[85];
char field[85];
Expand Down
2 changes: 2 additions & 0 deletions contrib/uiuc/plugins/molfile_plugin/src/parmplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@
#include "ReadPARM.h"
#include "molfile_plugin.h"

namespace {
typedef struct {
ReadPARM *rp;
FILE *parm;
int natoms;
int *from, *to;
} parmdata;
}

static void *open_parm_read(const char *filename, const char *,
int *natoms) {
Expand Down
6 changes: 4 additions & 2 deletions layer0/Isosurf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ Z* -------------------------------------------------------------------

#define I4(field,P1,P2,P3,P4) ((field)->get<int>(P1,P2,P3,P4))

typedef struct PointType {
namespace {
struct PointType {
float Point[3];
int NLink;
struct PointType* Link[4];
} PointType;
};
}

#define EdgePtPtr(field,P2,P3,P4,P5) ((field)->ptr(P2,P3,P4,P5))

Expand Down
6 changes: 4 additions & 2 deletions layer0/Tetsurf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ Z* -------------------------------------------------------------------

#define I3(field,P1,P2,P3) ((field)->get<int>(P1,P2,P3))

typedef struct {
namespace {
struct PointType {
float Point[3];
float Normal[3];
int NormalFlag;
int Link;
} PointType;
};
}

typedef struct {
PointType *p[3];
Expand Down
2 changes: 2 additions & 0 deletions ov/src/OVOneToAny.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@

/* FYI: "up" stands for UniquePair -- a precursor to OneToAny */

namespace {
typedef struct {
int active;
ov_word forward_value, reverse_value;
ov_size forward_next;
} up_element;
}

struct _OVOneToAny {
OVHeap *heap;
Expand Down
2 changes: 2 additions & 0 deletions ov/src/OVOneToOne.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@

/* FYI: "up" stands for UniquePair -- a precursor to OneToOne */

namespace {
typedef struct {
int active;
ov_word forward_value, reverse_value;
ov_size forward_next, reverse_next;
} up_element;
}

struct _OVOneToOne {
OVHeap *heap;
Expand Down

0 comments on commit 9d3061c

Please sign in to comment.