Overview
SHA1 Hash: | 8bf744898706956471449743f48d962af5b42972 |
---|---|
Date: | 2011-05-19 08:27:51 |
User: | kinaba |
Comment: | Tabun fixed long[] problem of TZTester (not tested yet). |
Timelines: | family | ancestors | descendants | both | trunk |
Downloads: | Tarball | ZIP archive |
Other Links: | files | file ages | manifest |
Tags And Properties
- branch=trunk inherited from [9165bd3629]
- sym-trunk inherited from [9165bd3629]
Changes
Modified TZTesterSp/tangentz/TZTester.java from [8b0f3086985103aa] to [9ea2716e7a7a319a].
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 }