Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
wendelin.core
Commits
4642983d
Commit
4642983d
authored
Nov 21, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
X move fmt -> pygolang (there was a bug in the implementation and it needed tests)
parent
f61e2be3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
67 deletions
+4
-67
wcfs/internal/wcfs_misc.cpp
wcfs/internal/wcfs_misc.cpp
+1
-51
wcfs/internal/wcfs_misc.h
wcfs/internal/wcfs_misc.h
+0
-16
wcfs/internal/wcfs_virtmem.cpp
wcfs/internal/wcfs_virtmem.cpp
+2
-0
wcfs/internal/wcfs_watchlink.cpp
wcfs/internal/wcfs_watchlink.cpp
+1
-0
No files found.
wcfs/internal/wcfs_misc.cpp
View file @
4642983d
...
...
@@ -23,6 +23,7 @@
#include <golang/libgolang.h>
#include <golang/errors.h>
#include <golang/fmt.h>
using
namespace
golang
;
#include <inttypes.h>
...
...
@@ -158,57 +159,6 @@ error map_into(void *addr, size_t size, int prot, int flags, const os::File f, o
}
// mm::
// fmt::
namespace
fmt
{
static
string
_vsprintf
(
const
char
*
format
,
va_list
argp
)
{
// based on https://stackoverflow.com/a/26221725/9456786
va_list
argp2
;
va_copy
(
argp2
,
argp
);
size_t
size
=
vsnprintf
(
NULL
,
0
,
format
,
argp2
);
va_end
(
argp2
);
std
::
unique_ptr
<
char
[]
>
buf
(
new
char
[
size
]
);
vsnprintf
(
buf
.
get
(),
size
,
format
,
argp
);
return
string
(
buf
.
get
(),
buf
.
get
()
+
size
-
1
);
// without trailing '\0'
}
string
sprintf
(
const
string
&
format
,
...)
{
va_list
argp
;
va_start
(
argp
,
format
);
string
str
=
fmt
::
_vsprintf
(
format
.
c_str
(),
argp
);
va_end
(
argp
);
return
str
;
}
string
sprintf
(
const
char
*
format
,
...)
{
va_list
argp
;
va_start
(
argp
,
format
);
string
str
=
fmt
::
_vsprintf
(
format
,
argp
);
va_end
(
argp
);
return
str
;
}
error
errorf
(
const
string
&
format
,
...)
{
va_list
argp
;
va_start
(
argp
,
format
);
error
err
=
errors
::
New
(
fmt
::
sprintf
(
format
.
c_str
(),
argp
));
va_end
(
argp
);
return
err
;
}
error
errorf
(
const
char
*
format
,
...)
{
va_list
argp
;
va_start
(
argp
,
format
);
error
err
=
errors
::
New
(
fmt
::
sprintf
(
format
,
argp
));
va_end
(
argp
);
return
err
;
}
}
// fmt::
// strings::
namespace
strings
{
...
...
wcfs/internal/wcfs_misc.h
View file @
4642983d
...
...
@@ -127,22 +127,6 @@ namespace mm {
}
// mm::
// fmt::
namespace
fmt
{
string
sprintf
(
const
string
&
format
,
...);
error
errorf
(
const
string
&
format
,
...);
// `const char *` overload just to catch format mistakes as
// __attribute__(format) does not work with std::string.
string
sprintf
(
const
char
*
format
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
error
errorf
(
const
char
*
format
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
}
// fmt::
// strings::
namespace
strings
{
...
...
wcfs/internal/wcfs_virtmem.cpp
View file @
4642983d
...
...
@@ -29,6 +29,8 @@
#include <wendelin/bigfile/ram.h>
//#include <wendelin/bug.h>
#include <golang/fmt.h>
#include <algorithm>
#include <string>
#include <vector>
...
...
wcfs/internal/wcfs_watchlink.cpp
View file @
4642983d
...
...
@@ -21,6 +21,7 @@
#include "wcfs.h"
#include "wcfs_watchlink.h"
#include <golang/fmt.h>
#include <string.h>
_WatchLink
::
_WatchLink
()
{}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment