mirror of
https://github.com/dreamlayers/netbsd-mopd.git
synced 2026-04-13 23:33:46 +00:00
gcc-4.5 is picky about potential negative indexes. appease it.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile,v 1.16 2011/06/22 02:49:45 mrg Exp $
|
||||
# $NetBSD: Makefile,v 1.17 2011/08/16 16:45:20 christos Exp $
|
||||
|
||||
LIBISPRIVATE= yes
|
||||
|
||||
@@ -23,8 +23,3 @@ version.c: VERSION
|
||||
.if defined(HAVE_GCC) || defined(HAVE_PCC)
|
||||
COPTS.print.c+= -Wno-pointer-sign
|
||||
.endif
|
||||
|
||||
# XXX
|
||||
.if ${HAVE_GCC} == 45
|
||||
COPTS.file.c+= -Wno-error
|
||||
.endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: file.c,v 1.12 2009/10/20 00:51:13 snj Exp $ */
|
||||
/* $NetBSD: file.c,v 1.13 2011/08/16 16:45:20 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995-96 Mats O Jansson. All rights reserved.
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: file.c,v 1.12 2009/10/20 00:51:13 snj Exp $");
|
||||
__RCSID("$NetBSD: file.c,v 1.13 2011/08/16 16:45:20 christos Exp $");
|
||||
#endif
|
||||
|
||||
#include "os.h"
|
||||
@@ -115,7 +115,10 @@ mopFileGetLX(buf, idx, cnt)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < cnt; i++) {
|
||||
ret = ret*256 + buf[idx+cnt-1-i];
|
||||
int j = idx + cnt - 1 - i;
|
||||
if (j < 0)
|
||||
abort();
|
||||
ret = ret * 256 + buf[j];
|
||||
}
|
||||
|
||||
return(ret);
|
||||
@@ -130,7 +133,10 @@ mopFileGetBX(buf, idx, cnt)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < cnt; i++) {
|
||||
ret = ret*256 + buf[idx+i];
|
||||
int j = idx + i;
|
||||
if (j < 0)
|
||||
abort();
|
||||
ret = ret * 256 + buf[j];
|
||||
}
|
||||
|
||||
return(ret);
|
||||
|
||||
Reference in New Issue
Block a user