From: mdw Date: Wed, 2 Jun 1999 17:03:29 +0000 (+0000) Subject: Fix use of `octet' now that mLib includes `bits.h' (as of version 1.3.5 X-Git-Tag: 1.0.2~54 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/sw-tools/commitdiff_plain/fb28c8b9c24adb65b22bf8ee418b336c1572f0de Fix use of `octet' now that mLib includes `bits.h' (as of version 1.3.5 release). Also use the mLib load and store macros rather than doing it by hand. --- diff --git a/src/sw_rsh.c b/src/sw_rsh.c index 3c910df..fdacf12 100644 --- a/src/sw_rsh.c +++ b/src/sw_rsh.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: sw_rsh.c,v 1.1 1999/06/02 16:53:34 mdw Exp $ + * $Id: sw_rsh.c,v 1.2 1999/06/02 17:03:29 mdw Exp $ * * Run remote commands * @@ -29,8 +29,13 @@ /*----- Revision history --------------------------------------------------* * * $Log: sw_rsh.c,v $ - * Revision 1.1 1999/06/02 16:53:34 mdw - * Initial revision + * Revision 1.2 1999/06/02 17:03:29 mdw + * Fix use of `octet' now that mLib includes `bits.h' (as of version 1.3.5 + * release). Also use the mLib load and store macros rather than doing it + * by hand. + * + * Revision 1.1.1.1 1999/06/02 16:53:34 mdw + * Initial import. * */ @@ -59,6 +64,7 @@ #endif #include +#include #include #include #include @@ -74,8 +80,6 @@ /*----- Data structures ---------------------------------------------------*/ -typedef unsigned char octet; - #define PKHEADSZ 3 typedef struct pkhead { @@ -125,8 +129,7 @@ int pksend(sw_remote *r, int type, const void *p, size_t sz) /* --- Set up the packet header --- */ chunk = (sz > PKMAX ? PKMAX : sz); - h.len[0] = chunk & 0xff; - h.len[1] = (chunk >> 8) & 0xff; + STORE16(h.len, chunk); /* --- Write the packet header --- */ @@ -221,7 +224,7 @@ int pkrecv(sw_remote *r) /* --- Sort out what's going on --- */ - sz = h.len[0] | (h.len[1] << 8); + sz = LOAD16(h.len); r->sz = sz; if (!sz) return (h.type);