Skip to content

Commit

Permalink
Fix an ambiguity with recent C++ compilers
Browse files Browse the repository at this point in the history
  • Loading branch information
Arkanosis committed Sep 1, 2016
1 parent 8bab5f9 commit 4f78e22
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions shedskin/lib/builtin/format.cpp
Expand Up @@ -82,7 +82,7 @@ str *do_asprintf_str(const char *fmt, str *s, pyobj *a1, pyobj *a2) {
char *d;
int x;
str *r;
int nullchars = (s->find('\0') != -1); /* XXX %6.s */
int nullchars = ((const str*)s)->find('\0') != -1; /* XXX %6.s */
ssize_t len = s->size();
str *old_s = s;
if(nullchars) {
Expand Down Expand Up @@ -168,12 +168,12 @@ str *__mod4(str *fmts, list<pyobj *> *vals) {
char c = fmt->c_str()[j];
if(c != '%')
p = modgetitem(vals, i++);

switch(c) {
case 'c':
__modfill(&fmt, mod_to_c2(p), &r, a1, a2);
break;
case 's':
case 's':
case 'r':
__modfill(&fmt, p, &r, a1, a2);
break;
Expand Down Expand Up @@ -323,7 +323,7 @@ void print(int n, file *f, str *end, str *sep, ...) {
f->write(s);
f->write(end);
}
else
else
printf("%s%s", s->c_str(), end->c_str());
}

Expand Down

0 comments on commit 4f78e22

Please sign in to comment.