Project

General

Profile

gromacs-3.3-compile-fixes.patch

Fixes the problems I describe. My fix for the enum issue isn't actually a terrific one as it uses a cast, but at least it shuts gcc up. - Tom Joseph, 03/05/2006 07:34 AM

View differences:

gromacs-3.3-mpi/src/gmxlib/nonbonded/nb_kernel/mknb.c Sun Mar 5 01:14:42 2006
299 299
	/* Coulomb interaction alteratives */
300 300
	for(mknb_func.coul=MKNB_COUL_NO;
301 301
		mknb_func.coul<MKNB_COUL_NR;
302
		mknb_func.coul++) {
302
		mknb_func.coul = mknb_coul(mknb_func.coul + 1)) {
303 303

  
304 304
		/* VdW interaction alternatives */
305 305
		for(mknb_func.vdw=MKNB_VDW_NO;
306 306
			mknb_func.vdw<MKNB_VDW_NR;
307
			mknb_func.vdw++) {
307
			mknb_func.vdw = mknb_vdw(mknb_func.vdw + 1)) {
308 308

  
309 309
			/* Skip the case when we dont have any interaction at all */
310 310
			if(mknb_func.coul==MKNB_COUL_NO && mknb_func.vdw==MKNB_VDW_NO)
......
313 313
			/* Water optimization alternatives */
314 314
			for(mknb_func.water=MKNB_WATER_NO;
315 315
				mknb_func.water<MKNB_WATER_NR;
316
				mknb_func.water++) {
316
				mknb_func.water = mknb_water(mknb_func.water + 1)) {
317 317

  
318 318
				/* Water optimization is useless without coulomb */
319 319
				if(mknb_func.coul==MKNB_COUL_NO && 
gromacs-3.3-mpi/src/gmxlib/nonbonded/nb_kernel/mknb_metacode.c Sun Mar 5 01:15:30 2006
94 94
void
95 95
mknb_declare_real(char *name)
96 96
{
97
  char typename[255];
97
  char type_name[255];
98 98

  
99 99
  if(mknb_fortran) 
100
    sprintf(typename, "%-13s", mknb_double ? "real*8" : "real*4");
100
    sprintf(type_name, "%-13s", mknb_double ? "real*8" : "real*4");
101 101
  else
102
    sprintf(typename, "%-13s", mknb_double ? "double" : "float");
102
    sprintf(type_name, "%-13s", mknb_double ? "double" : "float");
103 103

  
104
  mknb_code("%s %s%s",typename,name, mknb_fortran ? "" : ";");
104
  mknb_code("%s %s%s",type_name,name, mknb_fortran ? "" : ";");
105 105
}
106 106

  
107 107
/* Declare a single-precision floating point var. */
108 108
void
109 109
mknb_declare_real4(char *name)
110 110
{
111
  char typename[255];
111
  char type_name[255];
112 112

  
113
  sprintf(typename, "%-13s", mknb_fortran ? "real*4" : "float");
113
  sprintf(type_name, "%-13s", mknb_fortran ? "real*4" : "float");
114 114

  
115
  mknb_code("%s %s%s", typename ,name, mknb_fortran ? "" : ";");
115
  mknb_code("%s %s%s", type_name ,name, mknb_fortran ? "" : ";");
116 116
}
117 117

  
118 118

  
......
120 120
void
121 121
mknb_declare_const_real(char *name, double value)
122 122
{
123
  char typename[255];
123
  char type_name[255];
124 124

  
125 125
  if(mknb_fortran) {
126
    sprintf(typename, "%-13s", mknb_double ? "real*8" : "real*4");
127
    mknb_code("%s %s",typename,name);
126
    sprintf(type_name, "%-13s", mknb_double ? "real*8" : "real*4");
127
    mknb_code("%s %s",type_name,name);
128 128
    mknb_code("    parameter (%s = %f)",name,value);
129 129
  } else {
130
    sprintf(typename, "%-13s",
130
    sprintf(type_name, "%-13s",
131 131
	    mknb_double ? "const double" : "const float");
132
    mknb_code("%s %s = %.16f;",typename,name,value);
132
    mknb_code("%s %s = %.16f;",type_name,name,value);
133 133
  }
134 134
}
135 135

  
......
137 137
void
138 138
mknb_declare_int(char *name)
139 139
{
140
  char typename[255];
140
  char type_name[255];
141 141

  
142
  sprintf(typename, "%-13s", mknb_fortran ? "integer*4" : "int"); 
142
  sprintf(type_name, "%-13s", mknb_fortran ? "integer*4" : "int"); 
143 143

  
144
  mknb_code("%s %s%s", typename ,name, mknb_fortran ? "" : ";");
144
  mknb_code("%s %s%s", type_name ,name, mknb_fortran ? "" : ";");
145 145
}
146 146

  
147 147

  
......
149 149
void
150 150
mknb_declare_const_int(char *name, int value)
151 151
{
152
  char typename[255];
152
  char type_name[255];
153 153

  
154
  sprintf(typename, "%-13s", mknb_fortran ? "integer*4" : "const int");
154
  sprintf(type_name, "%-13s", mknb_fortran ? "integer*4" : "const int");
155 155

  
156 156
  if(mknb_fortran) {
157
    mknb_code("%s %s", typename ,name);
157
    mknb_code("%s %s", type_name ,name);
158 158
    mknb_code("    parameter (%s = %d)",name,value);
159 159
  } else
160
    mknb_code("%s %s = %d;", typename ,name, value);
160
    mknb_code("%s %s = %d;", type_name ,name, value);
161 161
}
162 162

  
163 163
/* 4-byte Integer (same size as single precision fp) */
164 164
void
165 165
mknb_declare_int4(char *name)
166 166
{
167
  char typename[255];
167
  char type_name[255];
168 168

  
169
  sprintf(typename, "%-13s", mknb_fortran ? "integer*4" : "int"); 
169
  sprintf(type_name, "%-13s", mknb_fortran ? "integer*4" : "int"); 
170 170

  
171
  mknb_code("%s %s%s", typename ,name, mknb_fortran ? "" : ";");
171
  mknb_code("%s %s%s", type_name ,name, mknb_fortran ? "" : ";");
172 172
}
173 173

  
174 174

  
175 175
/* Arbitrary declaration */
176 176
void
177
mknb_declare_other(char *typename,char *name)
177
mknb_declare_other(char *type_name,char *name)
178 178
{
179 179
  char tmp[255];
180
  sprintf(tmp,"%-13s", typename);
180
  sprintf(tmp,"%-13s", type_name);
181 181

  
182 182
  mknb_code("%s %s%s", tmp, name, mknb_fortran ? "" : ";");
183 183
}
gromacs-3.3-mpi/src/gmxlib/nonbonded/nb_kernel/mknb_metacode.h Sun Mar 5 01:06:49 2006
303 303
 *  \param name      Name of the variable
304 304
 */
305 305
void
306
mknb_declare_other          (char *     typename,
306
mknb_declare_other          (char *,
307 307
							 char *     name);
308 308

  
309 309