Mercurial > ecos
changeset 1701:58c90207d719
fix a harmless operator precedence buglet
| author | jani |
|---|---|
| date | Fri, 06 Aug 2004 12:50:28 +0000 |
| parents | f2ac5da82476 |
| children | 8c724711d2d4 |
| files | packages/io/eth/current/ChangeLog packages/io/eth/current/src/stand_alone/eth_drv.c |
| diffstat | 2 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/packages/io/eth/current/ChangeLog +++ b/packages/io/eth/current/ChangeLog @@ -1,3 +1,8 @@ +2004-08-06 Jani Monoses <jani@iv.ro> + + * src/stand_alone/eth_drv.c: Add parantheses to fix operator + precedence bugs even though they were harmless in practice. + 2004-01-09 Jani Monoses <jani@iv.ro> * include/eth_drv.h:
--- a/packages/io/eth/current/src/stand_alone/eth_drv.c +++ b/packages/io/eth/current/src/stand_alone/eth_drv.c @@ -276,7 +276,7 @@ eth_drv_write(char *eth_hdr, char *buf, sc->funs->eth_drv_old = sc->funs->eth_drv; sc->funs->eth_drv = ð_drv_funs; // Substitute stand-alone driver old_state = sc->state; - if (!old_state & ETH_DRV_STATE_ACTIVE) { + if (!(old_state & ETH_DRV_STATE_ACTIVE)) { // This interface not fully initialized, do it now (sc->funs->start)(sc, (unsigned char *)sc->sc_arpcom.esa, 0); sc->state |= ETH_DRV_STATE_ACTIVE; @@ -323,7 +323,7 @@ eth_drv_write(char *eth_hdr, char *buf, } reset_and_out: if (dbg) { -// if (!old_state & ETH_DRV_STATE_ACTIVE) { +// if (!(old_state & ETH_DRV_STATE_ACTIVE)) { // // This interface was not fully initialized, shut it back down // (sc->funs->stop)(sc); // } @@ -388,7 +388,7 @@ eth_drv_read(char *eth_hdr, char *buf, i sc->funs->eth_drv_old = sc->funs->eth_drv; sc->funs->eth_drv = ð_drv_funs; // Substitute stand-alone driver old_state = sc->state; - if (!old_state & ETH_DRV_STATE_ACTIVE) { + if (!(old_state & ETH_DRV_STATE_ACTIVE)) { // This interface not fully initialized, do it now (sc->funs->start)(sc, (unsigned char *)sc->sc_arpcom.esa, 0); sc->state |= ETH_DRV_STATE_ACTIVE;
