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
436772a9
Commit
436772a9
authored
7 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
fix warnings
parent
e37d65b4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Common/GmshSocket.h
+6
-6
6 additions, 6 deletions
Common/GmshSocket.h
Common/onelab.h
+14
-0
14 additions, 0 deletions
Common/onelab.h
with
20 additions
and
6 deletions
Common/GmshSocket.h
+
6
−
6
View file @
436772a9
...
...
@@ -104,10 +104,10 @@ class GmshSocket{
int
_SendData
(
const
void
*
buffer
,
int
bytes
)
{
const
char
*
buf
=
(
const
char
*
)
buffer
;
int
sofar
=
0
;
int
remaining
=
bytes
;
long
int
sofar
=
0
;
long
int
remaining
=
bytes
;
do
{
int
len
=
send
(
_sock
,
buf
+
sofar
,
remaining
,
0
);
long
int
len
=
send
(
_sock
,
buf
+
sofar
,
remaining
,
0
);
if
(
len
<
0
)
return
-
1
;
// error
sofar
+=
len
;
remaining
-=
len
;
...
...
@@ -119,10 +119,10 @@ class GmshSocket{
int
_ReceiveData
(
void
*
buffer
,
int
bytes
)
{
char
*
buf
=
(
char
*
)
buffer
;
int
sofar
=
0
;
int
remaining
=
bytes
;
long
int
sofar
=
0
;
long
int
remaining
=
bytes
;
do
{
int
len
=
recv
(
_sock
,
buf
+
sofar
,
remaining
,
0
);
long
int
len
=
recv
(
_sock
,
buf
+
sofar
,
remaining
,
0
);
if
(
len
==
0
)
break
;
// we're done!
if
(
len
<
0
)
return
-
1
;
// error
sofar
+=
len
;
...
...
This diff is collapsed.
Click to expand it.
Common/onelab.h
+
14
−
0
View file @
436772a9
...
...
@@ -38,7 +38,11 @@
#include
<algorithm>
#include
<sstream>
#include
"GmshSocket.h"
#define HAVE_PICOJSON
#if defined(HAVE_PICOJSON)
#include
"picojson.h"
#endif
namespace
onelab
{
...
...
@@ -362,6 +366,7 @@ namespace onelab{
}
return
sstream
.
str
();
}
#if defined(HAVE_PICOJSON)
virtual
bool
fromJSON
(
const
picojson
::
value
::
object
&
par
)
{
for
(
picojson
::
value
::
object
::
const_iterator
it
=
par
.
begin
();
it
!=
par
.
end
();
++
it
){
...
...
@@ -410,6 +415,7 @@ namespace onelab{
}
return
true
;
}
#endif
};
class
parameterLessThan
{
...
...
@@ -579,6 +585,7 @@ namespace onelab{
sstream
<<
" }"
;
return
sstream
.
str
();
}
#if defined(HAVE_PICOJSON)
bool
fromJSON
(
const
picojson
::
value
::
object
&
par
)
{
if
(
!
parameter
::
fromJSON
(
par
))
return
false
;
...
...
@@ -628,6 +635,7 @@ namespace onelab{
}
return
true
;
}
#endif
};
// The string class. A string has a mutable "kind", that can be changed at
...
...
@@ -727,6 +735,7 @@ namespace onelab{
sstream
<<
" }"
;
return
sstream
.
str
();
}
#if defined(HAVE_PICOJSON)
bool
fromJSON
(
const
picojson
::
value
::
object
&
par
)
{
if
(
!
parameter
::
fromJSON
(
par
))
return
false
;
...
...
@@ -756,6 +765,7 @@ namespace onelab{
}
return
true
;
}
#endif
};
// The parameter space, i.e., the set of parameters stored and handled by the
...
...
@@ -1014,6 +1024,7 @@ namespace onelab{
json
+=
"
\n
] }
\n
}
\n
"
;
return
true
;
}
#if defined(HAVE_PICOJSON)
bool
fromJSON
(
const
std
::
string
&
json
,
const
std
::
string
&
client
=
""
)
{
picojson
::
value
v
;
...
...
@@ -1051,6 +1062,7 @@ namespace onelab{
}
return
true
;
}
#endif
};
// The onelab client: a class that communicates with the onelab server. Each
...
...
@@ -1215,10 +1227,12 @@ namespace onelab{
{
return
_parameterSpace
.
toJSON
(
json
,
client
);
}
#if defined(HAVE_PICOJSON)
bool
fromJSON
(
const
std
::
string
&
json
,
const
std
::
string
&
client
=
""
)
{
return
_parameterSpace
.
fromJSON
(
json
,
client
);
}
#endif
};
// A local client, which lives in the same memory space as the server.
...
...
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