Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
7ab9ecd6
Commit
7ab9ecd6
authored
11 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
Sprintf[] for compatibility with GetDP
parent
0273db17
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Parser/Gmsh.tab.cpp
+1374
-1318
1374 additions, 1318 deletions
Parser/Gmsh.tab.cpp
Parser/Gmsh.y
+25
-0
25 additions, 0 deletions
Parser/Gmsh.y
with
1399 additions
and
1318 deletions
Parser/Gmsh.tab.cpp
+
1374
−
1318
View file @
7ab9ecd6
Source diff could not be displayed: it is too large. Options to address this:
view the blob
.
This diff is collapsed.
Click to expand it.
Parser/Gmsh.y
+
25
−
0
View file @
7ab9ecd6
...
@@ -4940,6 +4940,11 @@ StringExpr :
...
@@ -4940,6 +4940,11 @@ StringExpr :
{
{
$$ = $3;
$$ = $3;
}
}
// for compatibility with GetDP
| tSprintf '[' StringExprVar ']'
{
$$ = $3;
}
| tSprintf '(' StringExprVar ',' RecursiveListOfDouble ')'
| tSprintf '(' StringExprVar ',' RecursiveListOfDouble ')'
{
{
char tmpstring[5000];
char tmpstring[5000];
...
@@ -4959,6 +4964,26 @@ StringExpr :
...
@@ -4959,6 +4964,26 @@ StringExpr :
}
}
List_Delete($5);
List_Delete($5);
}
}
// for compatibility with GetDP
| tSprintf '[' StringExprVar ',' RecursiveListOfDouble ']'
{
char tmpstring[5000];
int i = PrintListOfDouble($3, $5, tmpstring);
if(i < 0){
yymsg(0, "Too few arguments in Sprintf");
$$ = $3;
}
else if(i > 0){
yymsg(0, "%d extra argument%s in Sprintf", i, (i > 1) ? "s" : "");
$$ = $3;
}
else{
$$ = (char*)Malloc((strlen(tmpstring) + 1) * sizeof(char));
strcpy($$, tmpstring);
Free($3);
}
List_Delete($5);
}
;
;
RecursiveListOfStringExprVar :
RecursiveListOfStringExprVar :
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment