Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
e087a276
Commit
e087a276
authored
Aug 05, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GCC doesn't like zero-length format strings
parent
7e767178
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
17 deletions
+11
-17
src/runtime/builtin_modules/sys.cpp
src/runtime/builtin_modules/sys.cpp
+1
-2
src/runtime/file.cpp
src/runtime/file.cpp
+4
-7
src/runtime/iterobject.cpp
src/runtime/iterobject.cpp
+1
-1
src/runtime/list.cpp
src/runtime/list.cpp
+2
-3
src/runtime/long.cpp
src/runtime/long.cpp
+2
-3
src/runtime/objmodel.cpp
src/runtime/objmodel.cpp
+1
-1
No files found.
src/runtime/builtin_modules/sys.cpp
View file @
e087a276
...
...
@@ -88,8 +88,7 @@ BoxedList* getSysPath() {
assert
(
_sys_path
);
if
(
_sys_path
->
cls
!=
list_cls
)
{
fprintf
(
stderr
,
"RuntimeError: sys.path must be a list of directory name
\n
"
);
raiseExcHelper
(
RuntimeError
,
""
);
raiseExcHelper
(
RuntimeError
,
"sys.path must be a list of directory names"
);
}
assert
(
_sys_path
->
cls
==
list_cls
);
...
...
src/runtime/file.cpp
View file @
e087a276
...
...
@@ -433,8 +433,7 @@ static PyObject* get_line(BoxedFile* f, int n) noexcept {
Box
*
fileRead
(
BoxedFile
*
self
,
Box
*
_size
)
{
assert
(
self
->
cls
==
file_cls
);
if
(
_size
->
cls
!=
int_cls
)
{
fprintf
(
stderr
,
"TypeError: an integer is required
\n
"
);
raiseExcHelper
(
TypeError
,
""
);
raiseExcHelper
(
TypeError
,
"an integer is required"
);
}
int64_t
size
=
static_cast
<
BoxedInt
*>
(
_size
)
->
n
;
...
...
@@ -943,12 +942,10 @@ Box* fileNew(BoxedClass* cls, Box* s, Box* m, Box** args) {
m
=
_PyUnicode_AsDefaultEncodedString
(
m
,
NULL
);
if
(
s
->
cls
!=
str_cls
)
{
fprintf
(
stderr
,
"TypeError: coercing to Unicode: need string of buffer, %s found
\n
"
,
getTypeName
(
s
));
raiseExcHelper
(
TypeError
,
""
);
raiseExcHelper
(
TypeError
,
"coercing to Unicode: need string of buffer, %s found"
,
getTypeName
(
s
));
}
if
(
m
->
cls
!=
str_cls
)
{
fprintf
(
stderr
,
"TypeError: coercing to Unicode: need string of buffer, %s found
\n
"
,
getTypeName
(
m
));
raiseExcHelper
(
TypeError
,
""
);
raiseExcHelper
(
TypeError
,
"coercing to Unicode: need string of buffer, %s found"
,
getTypeName
(
m
));
}
if
(
!
PyInt_Check
(
buffering
))
...
...
@@ -1111,7 +1108,7 @@ Box* fileIterNext(BoxedFile* s) {
Box
*
rtn
=
fileReadline1
(
s
);
assert
(
!
rtn
||
rtn
->
cls
==
str_cls
);
if
(
!
rtn
||
((
BoxedString
*
)
rtn
)
->
s
().
empty
())
raiseExcHelper
(
StopIteration
,
""
);
raiseExcHelper
(
StopIteration
,
(
const
char
*
)
NULL
);
return
rtn
;
}
...
...
src/runtime/iterobject.cpp
View file @
e087a276
...
...
@@ -103,7 +103,7 @@ Box* seqiterNext(Box* s) {
else
RELEASE_ASSERT
(
0
,
""
);
if
(
hasnext
==
False
)
raiseExcHelper
(
StopIteration
,
""
);
raiseExcHelper
(
StopIteration
,
(
const
char
*
)
NULL
);
}
RELEASE_ASSERT
(
self
->
next
,
""
);
...
...
src/runtime/list.cpp
View file @
e087a276
...
...
@@ -121,10 +121,9 @@ extern "C" Box* listPop(BoxedList* self, Box* idx) {
if
(
n
<
0
||
n
>=
self
->
size
)
{
if
(
self
->
size
==
0
)
fprintf
(
stderr
,
"IndexError: pop from empty list
\n
"
);
raiseExcHelper
(
IndexError
,
"pop from empty list
"
);
else
fprintf
(
stderr
,
"IndexError: pop index out of range
\n
"
);
raiseExcHelper
(
IndexError
,
""
);
raiseExcHelper
(
IndexError
,
"pop index out of range"
);
}
Box
*
rtn
=
self
->
elts
->
elts
[
n
];
...
...
src/runtime/long.cpp
View file @
e087a276
...
...
@@ -668,9 +668,8 @@ BoxedLong* _longNew(Box* val, Box* _base) {
Box
*
r
=
callattr
(
val
,
long_str
,
callattr_flags
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
!
r
)
{
fprintf
(
stderr
,
"TypeError: long() argument must be a string or a number, not '%s'
\n
"
,
getTypeName
(
val
));
raiseExcHelper
(
TypeError
,
""
);
raiseExcHelper
(
TypeError
,
"TypeError: long() argument must be a string or a number, not '%s'
\n
"
,
getTypeName
(
val
));
}
if
(
isSubclass
(
r
->
cls
,
int_cls
))
{
...
...
src/runtime/objmodel.cpp
View file @
e087a276
...
...
@@ -256,7 +256,7 @@ extern "C" void assertFail(Box* assertion_type, Box* msg) {
BoxedString
*
tostr
=
str
(
msg
);
raiseExcHelper
(
static_cast
<
BoxedClass
*>
(
assertion_type
),
"%s"
,
tostr
->
data
());
}
else
{
raiseExcHelper
(
static_cast
<
BoxedClass
*>
(
assertion_type
),
""
);
raiseExcHelper
(
static_cast
<
BoxedClass
*>
(
assertion_type
),
(
const
char
*
)
NULL
);
}
}
...
...
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