Changeset aa4d31 in git
- Timestamp:
- Feb 7, 2019, 1:18:27 PM (4 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 098784114c00a08a4d18cf392c0f2411aa0d007ed669f7b103e531e130535f2141dd1d77cfa31a81
- Parents:
- 54b24c79febc0e79ee3f9c6a86b7c4d505c69a43
- Files:
-
- 12 added
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/dyn_modules/gfanlib/gfanlib.cc
r54b24c raa4d31 24 24 bbpolytope_setup(p); 25 25 tropical_setup(p); 26 VARreturn MAX_TOK;26 return MAX_TOK; 27 27 } 28 28 -
Singular/dyn_modules/polymake/polymake_wrapper.cc
r54b24c raa4d31 1979 1979 p->iiAddCproc("polymakeInterface.lib","vertexEdgeGraph",FALSE,PMvertexEdgeGraph); 1980 1980 1981 VARblackbox* b=getBlackboxStuff(polytopeID);1981 blackbox* b=getBlackboxStuff(polytopeID); 1982 1982 b->blackbox_Op2=bbpolytope_Op2; 1983 1983 1984 1984 init_polymake_help(); 1985 VARreturn MAX_TOK;1985 return MAX_TOK; 1986 1986 } 1987 1987 -
Singular/dyn_modules/pyobject/pyobject.cc
r54b24c raa4d31 717 717 extern "C" int SI_MOD_INIT(pyobject)(SModulFunctions* psModulFunctions) 718 718 { 719 VARint tok = -1;720 VARblackbox* bbx = pyobject_blackbox(tok);719 int tok = -1; 720 blackbox* bbx = pyobject_blackbox(tok); 721 721 if (bbx->blackbox_Init != pyobject_Init) 722 722 { … … 738 738 PYOBJECT_ADD_C_PROC(python_run); 739 739 } 740 VARreturn MAX_TOK;740 return MAX_TOK; 741 741 } 742 742 #undef PYOBJECT_ADD_C_PROC -
Singular/dyn_modules/syzextra/mod_main.cc
r54b24c raa4d31 525 525 526 526 #undef ADD 527 VARreturn MAX_TOK;528 } 527 return MAX_TOK; 528 } -
gfanlib/gfanlib_circuittableint.cpp
r54b24c raa4d31 9 9 10 10 namespace gfan{ 11 INST_VAR class MVMachineIntegerOverflowMVMachineIntegerOverflow;11 INST_VAR MVMachineIntegerOverflowType MVMachineIntegerOverflow; 12 12 } -
gfanlib/gfanlib_circuittableint.h
r54b24c raa4d31 26 26 }; 27 27 28 EXTERN_INST_VAR MVMachineIntegerOverflow MVMachineIntegerOverflow; 28 typedef MVMachineIntegerOverflow MVMachineIntegerOverflowType; 29 30 EXTERN_INST_VAR MVMachineIntegerOverflowType MVMachineIntegerOverflow; 29 31 30 32 /* -
libpolys/misc/options.h
r54b24c raa4d31 11 11 /*the general set of verbose-options : si_opt_2(verbose) */ 12 12 #ifdef __cplusplus 13 extern "C" unsigned si_opt_1; //< NOTE: Original option variable name: test14 extern "C" unsigned si_opt_2; //< NOTE: Original option variable name: verbose13 extern "C" VAR unsigned si_opt_1; //< NOTE: Original option variable name: test 14 extern "C" VAR unsigned si_opt_2; //< NOTE: Original option variable name: verbose 15 15 extern "C" BOOLEAN siCntrlc; 16 16 #else -
libpolys/polys/weight.cc
r54b24c raa4d31 18 18 19 19 /*0 implementation*/ 20 extern "C" double (*wFunctional)(int *degw, int *lpol, int npol,20 extern "C" THREAD_VAR double (*wFunctional)(int *degw, int *lpol, int npol, 21 21 double *rel, double wx, double wNsqr); 22 22 extern "C" double wFunctionalMora(int *degw, int *lpol, int npol, -
libpolys/polys/weight.h
r54b24c raa4d31 24 24 25 25 // internal: 26 extern "C" double (*wFunctional)(int *degw, int *lpol, int npol,26 extern "C" THREAD_VAR double (*wFunctional)(int *degw, int *lpol, int npol, 27 27 double *rel, double wx, double wNsqr); 28 28 extern "C" double wFunctionalBuch(int *degw, int *lpol, int npol, -
ppcc/LICENSE
r54b24c raa4d31 1 This license applies to all parts of this software project that are not 2 third-party libraries. The third-party libraries are: 1 The AdLib system is distributed under the terms of the Boost Software 2 License 1.0 (see below). This license applies to all files in this directory 3 or any of its subdirectories that are not third-party libraries. The 4 following parts are third-party libraries: 3 5 4 * The Tiny GC garbage collector (comprising all files in the gclib5 directory).6 * The autosetup code (comprising allfiles in the autosetup directory).6 * The Tiny GC garbage collector and Doug Lea's malloc() implementation 7 (comprising the files in the gclib directory). 8 * The autosetup code (comprising the files in the autosetup directory). 7 9 8 These libraries have their own licenses whose terms differ from the9 t erms below.10 These third-party libraries have their own licenses whose terms differ from 11 those of the Boost Software License. 10 12 11 13 --------------------------------------------------------------------------- … … 35 37 --------------------------------------------------------------------------- 36 38 37 -
ppcc/adlib/os.cc
r54b24c raa4d31 11 11 if (fp == NULL) 12 12 return NULL; 13 Str *result = new Str(1024);13 StrArr *result = new StrArr(); 14 14 for (;;) { 15 15 size_t nbytes = fread(buffer, 1, sizeof(buffer), fp); 16 16 if (nbytes == 0) 17 17 break; 18 result->add( buffer, nbytes);19 } 20 return result;18 result->add(new Str(buffer, nbytes)); 19 } 20 return StrJoin(result, ""); 21 21 } 22 22 … … 197 197 } 198 198 199 Str * Pwd() {199 Str *CurrentDir() { 200 200 #ifdef PATH_MAX 201 201 char *path = getcwd(NULL, PATH_MAX); … … 389 389 } 390 390 391 Str *AbsolutePath(Str *path) { 392 if (path->starts_with(PathSeparator)) { 393 return path->clone(); 394 } 395 Str *result = CurrentDir(); 396 return result->add(PathSeparator)->add(path); 397 } 398 399 Str *NormalizePath(Str *path) { 400 bool abs = path->starts_with(PathSeparator); 401 StrArr *parts = path->split(PathSeparator); 402 StrArr *result = new StrArr(); 403 for (Int i = 0; i < parts->len(); i++) { 404 Str *part = parts->at(i); 405 if (part->eq("") || part->eq(".")) { 406 // do nothing 407 } else if (part->eq("..")) { 408 if (result->len() > 0) 409 result->pop(); 410 else if (!abs) 411 result->add(part); 412 } else { 413 result->add(part); 414 } 415 } 416 if (abs) 417 return S(PathSeparator)->add(StrJoin(result, PathSeparator)); 418 else 419 return StrJoin(result, PathSeparator); 420 } 421 422 Str *GetEnv(const char *name) { 423 char *result = getenv(name); 424 if (result) 425 return new Str(result); 426 else 427 return NULL; 428 } 429 430 Str *GetEnv(Str *name) { 431 return GetEnv(name->c_str()); 432 } 433 434 Str *ProgramPath() { 435 Str *arg0 = new Str(ArgV[0]); 436 Str *result = arg0; 437 if (arg0) { 438 if (FileStat(result, true)) { 439 return NormalizePath(AbsolutePath(result)); 440 } 441 if (!arg0->starts_with(PathSeparator)) { 442 Str *path = GetEnv("PATH"); 443 StrArr *paths = path ? path->split(':') : A(); 444 for (Int i = 0; i < paths->len(); i++) { 445 Str *p = paths->at(i)->clone(); 446 p->add(PathSeparator); 447 p->add(arg0); 448 if (FileStat(p, true)) { 449 result = p; 450 break; 451 } 452 } 453 } 454 } 455 return result ? NormalizePath(AbsolutePath(result)) : result; 456 } 457 391 458 bool MakeDir(const char *path, bool recursive) { 392 459 if (!recursive) -
ppcc/adlib/os.h
r54b24c raa4d31 32 32 }; 33 33 34 Str * Pwd();34 Str *CurrentDir(); 35 35 bool ChDir(Str *path); 36 36 bool ChDir(const char *path); … … 65 65 Str *BaseName(Str *path); 66 66 Str *FileExtension(Str *path); 67 Str *AbsolutePath(Str *path); 68 Str *NormalizePath(Str *path); 69 Str *GetEnv(Str *name); 70 Str *GetEnv(const char *name); 71 72 Str *ProgramPath(); 73 67 74 bool MakeDir(Str *path, bool recursive = false); 68 75 bool MakeDir(const char *path, bool recursive = false); -
ppcc/adlib/str.cc
r54b24c raa4d31 11 11 12 12 StrArr *Str::split(const char *s, Int n) { 13 if (n == 1) 14 return split(s[0]); 13 15 Arr<Int> *parts = new Arr<Int>(); 14 16 parts->add(-n); … … 96 98 if (arr->len() == 0) 97 99 return new Str(); 98 Str *result = new Str(arr->len() * (n + 1)); 100 Int len = (arr->len() - 1) * n; 101 for (Int i = 0; i < arr->len(); i++) { 102 len += arr->at(i)->len(); 103 } 104 Str *result = new Str(len); 99 105 result->add(arr->first()); 100 106 for (Int i = 1; i < arr->len(); i++) { 101 result->add(sep, n); 107 if (n >= 0) 108 result->add(sep, n); 102 109 result->add(arr->at(i)); 103 110 } -
ppcc/adlib/test1.cc
r54b24c raa4d31 58 58 Check(sum_tree(tree) * 2 == counter * (counter - 1), 59 59 "stress test memory allocation"); 60 Check(NormalizePath(S("/foo/x/../bar/./"))->eq("/foo/bar"), "normalize path"); 61 Check(BaseName(ProgramPath())->eq("test1"), "program path"); 60 62 } -
ppcc/adlib/test2.cc
r54b24c raa4d31 22 22 Check(ListFiles(".")->len() > 0, "reading directories"); 23 23 StrSet *files = new StrSet(ListFiles("adlib")); 24 files = new StrSet(ListFileTree( Pwd(), ListFilesRelative));24 files = new StrSet(ListFileTree(CurrentDir(), ListFilesRelative)); 25 25 Check(files->contains(S(__FILE__)), "reading directories recursively"); 26 26 } -
ppcc/auto.def
r54b24c raa4d31 117 117 proc check-tmp-flags {flags} { 118 118 msg-checking "Checking whether the C++ compiler accepts $flags..." 119 set iquote [cctest -cflags "-iquote ."]120 if {$ iquote} {119 set works [cctest -cflags $flags] 120 if {$works} { 121 121 msg-result yes 122 122 return 1 … … 192 192 } 193 193 cc-check-includes dirent.h 194 # -iquote vs. -I195 set iquote [check-tmp-flags "-iquote"]196 194 define OPT "" 197 195 foreach opt {{-g -O2} {-g -O} {-g}} { … … 287 285 set adlibsrc [glob adlib/*.cc] 288 286 if {!$boehm} { 289 lappend adlibsrc "gclib/ tinygc.c"287 lappend adlibsrc "gclib/gc.c" 290 288 } 291 289 … … 323 321 set progre [glob -nocomplain src/*.re] 324 322 set proghdr [glob -nocomplain src/*.h] 323 set testsrc [lsort -unique $testsrc] 325 324 set gensrc {} 326 325 foreach file $progre { -
ppcc/autosetup/autosetup
r54b24c raa4d31 1864 1864 {#!/bin/sh 1865 1865 dir="`dirname "$0"`/autosetup" 1866 WRAPPER="$0"; export WRAPPER; exec "` $dir/autosetup-find-tclsh`" "$dir/autosetup" "$@"1866 WRAPPER="$0"; export WRAPPER; exec "`"$dir/autosetup-find-tclsh"`" "$dir/autosetup" "$@" 1867 1867 } 1868 1868 } -
ppcc/autosetup/cc.tcl
r54b24c raa4d31 12 12 ## CC - C compiler 13 13 ## CXX - C++ compiler 14 ## CPP - C preprocessor 14 15 ## CCACHE - Set to "none" to disable automatic use of ccache 15 16 ## CFLAGS - Additional C compiler flags … … 700 701 define CCACHE [find-an-executable [get-env CCACHE ccache]] 701 702 703 # If any of these are set in the environment, propagate them to the AUTOREMAKE commandline 704 foreach i {CC CXX CCACHE CPP CFLAGS CXXFLAGS CXXFLAGS LDFLAGS LIBS CROSS CPPFLAGS LINKFLAGS CC_FOR_BUILD LD} { 705 if {[env-is-set $i]} { 706 # Note: If the variable is set on the command line, get-env will return that value 707 # so the command line will continue to override the environment 708 define-append AUTOREMAKE [quote-if-needed $i=[get-env $i ""]] 709 } 710 } 711 702 712 # Initial cctest settings 703 713 cc-store-settings {-cflags {} -includes {} -declare {} -link 0 -lang c -libs {} -code {} -nooutput 0} -
ppcc/autosetup/configure
r54b24c raa4d31 1 1 #!/bin/sh 2 2 dir="`dirname "$0"`/autosetup" 3 WRAPPER="$0"; export WRAPPER; exec "` $dir/autosetup-find-tclsh`" "$dir/autosetup" "$@"3 WRAPPER="$0"; export WRAPPER; exec "`"$dir/autosetup-find-tclsh"`" "$dir/autosetup" "$@" -
ppcc/src/parser.cc
r54b24c raa4d31 1 1 #include "adlib/lib.h" 2 2 #include "adlib/map.h" 3 #include "adlib/set.h" 3 4 #include "pplex.h" 4 5 … … 18 19 static Dict *class_vars; 19 20 static Dict *class_types; 21 static StrSet *type_prefix_set; 22 static Dict *namespaced; 20 23 21 24 enum DeclType { … … 37 40 GCVar(class_vars, new Dict()); 38 41 GCVar(class_types, new Dict()); 42 GCVar(type_prefix_set, new StrSet()); 43 type_prefix_set->add(S("class")); 44 type_prefix_set->add(S("struct")); 45 type_prefix_set->add(S("typedef")); 46 // special treatment for some gfanlib variables for now. 47 GCVar(namespaced, new Dict()); 48 namespaced->add(S("MVMachineIntegerOverflow"), S("gfan")); 49 namespaced->add(S("lpSolver"), S("gfan")); 39 50 }); 40 51 … … 244 255 } 245 256 if ((is_class && !is_extern) || init_start >= 0) { 246 if (is_toplevel) 257 if (is_toplevel) { 247 258 init_list->add(var_name); 259 } 248 260 Token var_init = Token(SymGen, var_name->clone()->add("__INIT__")); 249 261 parser->emit(static_token); … … 262 274 parser->init_count++; 263 275 parser->emit(Token(SymGen, S( 264 " staticpSingular_register_init_var(void *, void *, long);"276 "void pSingular_register_init_var(void *, void *, long);" 265 277 "class %s__CONSTR__ {\n" 266 " %s__CONSTR__() {\n"278 " public: %s__CONSTR__() {\n" 267 279 " pSingular_register_init_var(&%s, &%s__INIT__, sizeof(%s));\n" 268 280 " }\n" … … 281 293 Token &token = output->at(i); 282 294 if (token.sym == SymIdent && class_vars->contains(token.str)) { 283 token.str = class_vars->at(token.str); 295 Int j = i-1; 296 while (j >= 0 && TEST(SymsWS | BIT(SymAst), output->at(j).sym)) 297 j--; 298 if (j < 0 || !type_prefix_set->contains(output->at(j).str)) 299 token.str = class_vars->at(token.str); 284 300 } 285 301 } … … 318 334 if (class_vars->contains(var_name)) { 319 335 Str *type = class_types->at(var_name); 336 if (namespaced->contains(var_name)) { 337 type = namespaced->at(var_name)->clone()->add("::")->add(type); 338 var_name = namespaced->at(var_name)->clone()->add("::")->add(var_name); 339 } 320 340 init_part->add(S( 321 341 " %s = (%c *)pSingular_alloc_var((long)sizeof(%c));\n" … … 374 394 Int var_pos = -1, var_start = -1, var_end = -1; 375 395 var_start = parser->current_pos(); 376 parser->skip_while(SymsTypePrefix | BIT(SymWS) );396 parser->skip_while(SymsTypePrefix | BIT(SymWS) | BIT(SymClass)); 377 397 if (TEST(SymsEndDecl | BIT(SymLBrkt), parser->current_sym())) { 378 398 // We are one symbol past the initial variable identifier. … … 481 501 if (toplevel->len() > 0) 482 502 toplevel->pop(); 503 tl = 0; 483 504 parser->advance(); 484 505 break; -
ppcc/src/ppcc.cc
r54b24c raa4d31 160 160 void TestOutputExecutable() { 161 161 if (mode == LINK) { 162 Str *path = S("factory/threadsupport.cc"); 163 for (Int i = 0; i < 4; i++) { 164 if (FileStat(path)) { 165 ExtraArgs->add(path); 166 return; 167 } 168 path = S("../")->add(path); 162 if (Output && FileExtension(Output)->len() != 0) { 163 return; 164 } 165 Str *path = DirName(ProgramPath()); 166 if (path) { 167 path->add("/../Singular/threadsupport.cc"); 168 path = NormalizePath(path); 169 } 170 if (path && FileStat(path)) { 171 ExtraArgs->add(path); 172 } else { 173 PrintLn(path); 174 Error("cannot locate ppcc directory"); 169 175 } 170 176 }
Note: See TracChangeset
for help on using the changeset viewer.