libbio, libmach: warnings from the Plan 9 tool chain

Superficial inconsistencies that trigger warnings in
Plan 9.  Small enough to be considered trivial and
seemingly benign outside of the Plan 9 environment.

LGTM=iant
R=golang-codereviews, 0intro, iant
CC=golang-codereviews
https://golang.org/cl/73460043
This commit is contained in:
Lucio De Re 2014-04-07 08:40:13 -07:00 committed by Ian Lance Taylor
parent 8076f21e8e
commit 24192bbd00
3 changed files with 33 additions and 29 deletions

View file

@ -73,7 +73,7 @@ struct Biobuf
* next few bytes in little-endian order.
*/
#define BGETC(bp)\
((bp)->icount?(bp)->ebuf[(bp)->icount++]:Bgetc((bp)))
((bp)->icount?(int)((bp)->ebuf[(bp)->icount++]):Bgetc((bp)))
#define BGETLE2(bp)\
((bp)->icount<=-2?((bp)->icount+=2,((bp)->ebuf[(bp)->icount-2])|((bp)->ebuf[(bp)->icount-1]<<8)):Bgetle2((bp)))
#define BGETLE4(bp)\

View file

@ -36,7 +36,8 @@ Bputrune(Biobuf *bp, long c)
rune = (Rune)c;
if(rune < Runeself) {
BPUTC(bp, (int)rune);
n = BPUTC(bp, (int)rune);
USED(n);
return 1;
}
n = runetochar(str, &rune);

View file

@ -195,11 +195,10 @@ i386trace(Map *map, uvlong pc, uvlong sp, uvlong link, Tracer trace)
break;
if(s.value == morestack) {
if (0) {
// This code is old and won't work anymore.
// But no one uses it anyway.
// Leave it obviously broken until someone needs it.
werrstr("morestack not implemented correctly");
return -1;
// In the middle of morestack.
// Caller is m->morepc.
// Caller's caller is in m->morearg.
@ -222,6 +221,10 @@ i386trace(Map *map, uvlong pc, uvlong sp, uvlong link, Tracer trace)
findsym(pc, CTEXT, &s);
(*trace)(map, pc, sp, &s1); // morestack's caller; caller's caller's PC/SP
continue;
} else {
werrstr("morestack not implemented correctly");
return -1;
}
}
if(pc == lessstack) {