Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/lua/gpio Start numbering pions with 0, not 1. Ruined a ...



details:   https://anonhg.NetBSD.org/src/rev/3d87f2c56179
branches:  trunk
changeset: 771161:3d87f2c56179
user:      mbalmer <mbalmer%NetBSD.org@localhost>
date:      Sun Nov 13 09:46:11 2011 +0000

description:
Start numbering pions with 0, not 1.  Ruined a demo, so it was a bad idea.

diffstat:

 lib/lua/gpio/gpio.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 1526edf52c2a -r 3d87f2c56179 lib/lua/gpio/gpio.c
--- a/lib/lua/gpio/gpio.c       Sun Nov 13 09:41:46 2011 +0000
+++ b/lib/lua/gpio/gpio.c       Sun Nov 13 09:46:11 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gpio.c,v 1.3 2011/10/10 20:41:05 christos Exp $ */
+/*     $NetBSD: gpio.c,v 1.4 2011/11/13 09:46:11 mbalmer Exp $ */
 
 /*
  * Copyright (c) 2011 Marc Balmer <marc%msys.ch@localhost>
@@ -112,7 +112,7 @@
 {
        switch (lua_type(L, n)) {
        case LUA_TNUMBER:
-               req->gp_pin = (int)lua_tointeger(L, n) - 1;     /* 1 based! */
+               req->gp_pin = (int)lua_tointeger(L, n); /* not 1 based! */
                break;
        case LUA_TSTRING:
                strlcpy(req->gp_name, lua_tostring(L, n), sizeof(req->gp_name));



Home | Main Index | Thread Index | Old Index