Differences From Artifact [8b0f3086985103aa]:
- File
TZTesterSp/tangentz/TZTester.java
- 2011-02-23 11:52:24 - part of checkin [f19d33f1b6] on branch trunk - a bit of comment (user: kinaba) [annotate]
To Artifact [9ea2716e7a7a319a]:
- File
TZTesterSp/tangentz/TZTester.java
- 2011-05-19 08:27:51 - part of checkin [8bf7448987] on branch trunk - Tabun fixed long[] problem of TZTester (not tested yet). (user: kinaba) [annotate]
271 271 */
272 272 private void generate_parameter(int Index, StringBuffer Code, DataType ParamType, String Input)
273 273 {
274 274 // <<modified by cafelier>> : named parameters
275 275 String Name = (Index==-1 ? "_" : m_Problem.getParamNames()[Index]);
276 276
277 277 String Desc = ParamType.getBaseName();
278 + if (Desc.equals("long") || Desc.equals("Long"))
279 + Desc = "long long";
278 280
279 281 if (ParamType.getDimension() == 0)
280 282 {
281 283 // Just a scalar value, simply initialize it at declaration (long integers need an 'L' tagged on)
282 - if (Desc.equals("long") || Desc.equals("Long"))
284 + if (Desc.equals("long long"))
283 285 Code.append(ParamType.getDescriptor(m_Language) + " " + Name + " = " + Input + "LL; ");
284 286 else
285 287 Code.append(ParamType.getDescriptor(m_Language) + " " + Name + " = " + Input + "; ");
286 288 }
287 289 else
288 290 {
289 291 // <<modified by cafelier>> : empty array
................................................................................
290 292 if( Input.matches("^[\\s\\{\\}]+$") )
291 293 {
292 294 Code.append(ParamType.getDescriptor(m_Language) + " " + Name + "; ");
293 295 }
294 296 else
295 297 {
296 298 // Arrays need to be converted to vector<type> before passing
297 - Code.append(ParamType.getBaseName().toLowerCase() + " " + Name + "_[] = " + Input + ";\n\t");
299 + if (Desc.equals("long long"))
300 + Input = Input.replaceAll("¥¥d+","$1LL");
301 + Code.append(Desc.toLowerCase() + " " + Name + "_[] = " + Input + ";\n\t");
298 302 Code.append(" "+ParamType.getDescriptor(m_Language) + " " + Name + "(" + Name + "_, " + Name + "_+sizeof("+Name+"_)/sizeof(*"+Name+"_)); ");
299 303 }
300 304 }
301 305 }
302 306 }