Skip to content

Commit

Permalink
Merge pull request OpenEtherCATsociety#454 from nakarlsson/master
Browse files Browse the repository at this point in the history
Fix llvm compiler implicit-int-conversion warnings
  • Loading branch information
ArthurKetels authored Oct 12, 2020
2 parents b01ceb9 + 447d184 commit d9261e8
Show file tree
Hide file tree
Showing 29 changed files with 377 additions and 368 deletions.
34 changes: 17 additions & 17 deletions oshw/erika/nicdrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ void ec_setupheader(void *p)
* @param[in] port = port context struct
* @return new index.
*/
int ecx_getindex(ecx_portt *port)
uint8 ecx_getindex(ecx_portt *port)
{
int idx;
int cnt = 0;
uint8 idx;
uint8 cnt = 0;

ee_port_lock();

Expand Down Expand Up @@ -199,7 +199,7 @@ int ecx_getindex(ecx_portt *port)
* @param[in] idx = index in buffer array
* @param[in] bufstat = status to set
*/
void ecx_setbufstat(ecx_portt *port, int idx, int bufstat)
void ecx_setbufstat(ecx_portt *port, uint8 idx, int bufstat)
{
port->rxbufstat[idx] = bufstat;
if (port->redstate != ECT_RED_NONE)
Expand All @@ -212,7 +212,7 @@ void ecx_setbufstat(ecx_portt *port, int idx, int bufstat)
* @param[in] stacknumber = 0=Primary 1=Secondary stack
* @return socket send result
*/
int ecx_outframe(ecx_portt *port, int idx, int stacknumber)
int ecx_outframe(ecx_portt *port, uint8 idx, int stacknumber)
{
int lp;
ec_stackT *stack;
Expand All @@ -234,7 +234,7 @@ int ecx_outframe(ecx_portt *port, int idx, int stacknumber)
* @param[in] idx = index in tx buffer array
* @return socket send result
*/
int ecx_outframe_red(ecx_portt *port, int idx)
int ecx_outframe_red(ecx_portt *port, uint8 idx)
{
ec_comt *datagramP;
ec_etherheadert *ehp;
Expand Down Expand Up @@ -300,11 +300,11 @@ static int ecx_recvpkt(ecx_portt *port, int stacknumber)
* @return Workcounter if a frame is found with corresponding index, otherwise
* EC_NOFRAME or EC_OTHERFRAME.
*/
int ecx_inframe(ecx_portt *port, int idx, int stacknumber)
int ecx_inframe(ecx_portt *port, uint8 idx, int stacknumber)
{
uint16 l;
int rval;
int idxf;
uint8 idxf;
ec_etherheadert *ehp;
ec_comt *ecp;
ec_stackT *stack;
Expand Down Expand Up @@ -389,7 +389,7 @@ int ecx_inframe(ecx_portt *port, int idx, int stacknumber)
* @return Workcounter if a frame is found with corresponding index, otherwise
* EC_NOFRAME.
*/
static int ecx_waitinframe_red(ecx_portt *port, int idx, osal_timert *timer)
static int ecx_waitinframe_red(ecx_portt *port, uint8 idx, osal_timert *timer)
{
osal_timert timer2;
int wkc = EC_NOFRAME;
Expand Down Expand Up @@ -464,7 +464,7 @@ static int ecx_waitinframe_red(ecx_portt *port, int idx, osal_timert *timer)
* @return Workcounter if a frame is found with corresponding index, otherwise
* EC_NOFRAME.
*/
int ecx_waitinframe(ecx_portt *port, int idx, int timeout)
int ecx_waitinframe(ecx_portt *port, uint8 idx, int timeout)
{
int wkc;
osal_timert timer;
Expand All @@ -487,7 +487,7 @@ int ecx_waitinframe(ecx_portt *port, int idx, int timeout)
* @param[in] timeout = timeout in us
* @return Workcounter or EC_NOFRAME
*/
int ecx_srconfirm(ecx_portt *port, int idx, int timeout)
int ecx_srconfirm(ecx_portt *port, uint8 idx, int timeout)
{
int wkc = EC_NOFRAME;
osal_timert timer1, timer2;
Expand Down Expand Up @@ -529,32 +529,32 @@ int ec_getindex(void)
return ecx_getindex(&ecx_port);
}

void ec_setbufstat(int idx, int bufstat)
void ec_setbufstat(uint8 idx, int bufstat)
{
ecx_setbufstat(&ecx_port, idx, bufstat);
}

int ec_outframe(int idx, int stacknumber)
int ec_outframe(uint8 idx, int stacknumber)
{
return ecx_outframe(&ecx_port, idx, stacknumber);
}

int ec_outframe_red(int idx)
int ec_outframe_red(uint8 idx)
{
return ecx_outframe_red(&ecx_port, idx);
}

int ec_inframe(int idx, int stacknumber)
int ec_inframe(uint8 idx, int stacknumber)
{
return ecx_inframe(&ecx_port, idx, stacknumber);
}

int ec_waitinframe(int idx, int timeout)
int ec_waitinframe(uint8 idx, int timeout)
{
return ecx_waitinframe(&ecx_port, idx, timeout);
}

int ec_srconfirm(int idx, int timeout)
int ec_srconfirm(uint8 idx, int timeout)
{
return ecx_srconfirm(&ecx_port, idx, timeout);
}
Expand Down
30 changes: 15 additions & 15 deletions oshw/erika/nicdrv.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ typedef struct
/** temporary tx buffer length */
int txbuflength2;
/** last used frame index */
int lastidx;
uint8 lastidx;
/** current redundancy state */
int redstate;
/** pointer to redundancy port and buffers */
Expand All @@ -94,26 +94,26 @@ extern ecx_redportt ecx_redport;

int ec_setupnic(const char * ifname, int secondary);
int ec_closenic(void);
void ec_setbufstat(int idx, int bufstat);
int ec_getindex(void);
int ec_outframe(int idx, int sock);
int ec_outframe_red(int idx);
int ec_waitinframe(int idx, int timeout);
int ec_srconfirm(int idx,int timeout);
int ec_inframe(int idx, int stacknumber);
void ec_setbufstat(uint8 idx, int bufstat);
uint8 ec_getindex(void);
int ec_outframe(uint8 idx, int sock);
int ec_outframe_red(uint8 idx);
int ec_waitinframe(uint8 idx, int timeout);
int ec_srconfirm(uint8 idx,int timeout);
int ec_inframe(uint8 idx, int stacknumber);
#endif

void ec_setupheader(void *p);
int ecx_setupnic(ecx_portt *port, const char *ifname, int secondary);
int ecx_closenic(ecx_portt *port);
void ecx_setbufstat(ecx_portt *port, int idx, int bufstat);
int ecx_getindex(ecx_portt *port);
int ecx_outframe(ecx_portt *port, int idx, int sock);
int ecx_outframe_red(ecx_portt *port, int idx);
int ecx_waitinframe(ecx_portt *port, int idx, int timeout);
int ecx_srconfirm(ecx_portt *port, int idx,int timeout);
void ecx_setbufstat(ecx_portt *port, uint8 idx, int bufstat);
uint8 ecx_getindex(ecx_portt *port);
int ecx_outframe(ecx_portt *port, uint8 idx, int sock);
int ecx_outframe_red(ecx_portt *port, uint8 idx);
int ecx_waitinframe(ecx_portt *port, uint8 idx, int timeout);
int ecx_srconfirm(ecx_portt *port, uint8 idx,int timeout);

int ecx_inframe(ecx_portt *port, int idx, int stacknumber);
int ecx_inframe(ecx_portt *port, uint8 idx, int stacknumber);

#ifdef __cplusplus
}
Expand Down
32 changes: 16 additions & 16 deletions oshw/intime/nicdrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,10 @@ void ec_setupheader(void *p)
/** Get new frame identifier index and allocate corresponding rx buffer.
* @return new index.
*/
int ecx_getindex(ecx_portt *port)
uint8 ecx_getindex(ecx_portt *port)
{
uint8 idx;
int cnt;
uint8 cnt;

WaitForRtControl(port->getindex_region);

Expand Down Expand Up @@ -307,7 +307,7 @@ int ecx_getindex(ecx_portt *port)
* @param[in] idx = index in buffer array
* @param[in] bufstat = status to set
*/
void ecx_setbufstat(ecx_portt *port, int idx, int bufstat)
void ecx_setbufstat(ecx_portt *port, uint8 idx, int bufstat)
{
port->rxbufstat[idx] = bufstat;
if (port->redstate != ECT_RED_NONE)
Expand All @@ -321,7 +321,7 @@ void ecx_setbufstat(ecx_portt *port, int idx, int bufstat)
* @param[in] stacknumber = 0=Primary 1=Secondary stack
* @return socket send result
*/
int ecx_outframe(ecx_portt *port, int idx, int stacknumber)
int ecx_outframe(ecx_portt *port, uint8 idx, int stacknumber)
{
HPESTATUS status;
DWORD txstate;
Expand Down Expand Up @@ -384,7 +384,7 @@ int ecx_outframe(ecx_portt *port, int idx, int stacknumber)
* @param[in] idx = index in tx buffer array
* @return socket send result
*/
int ecx_outframe_red(ecx_portt *port, int idx)
int ecx_outframe_red(ecx_portt *port, uint8 idx)
{
HPESTATUS status;
ec_comt *datagramP;
Expand Down Expand Up @@ -471,7 +471,7 @@ static int ecx_recvpkt(ecx_portt *port, int stacknumber)
* @return Workcounter if a frame is found with corresponding index, otherwise
* EC_NOFRAME or EC_OTHERFRAME.
*/
int ecx_inframe(ecx_portt *port, int idx, int stacknumber)
int ecx_inframe(ecx_portt *port, uint8 idx, int stacknumber)
{
uint16 l;
int rval;
Expand Down Expand Up @@ -560,7 +560,7 @@ int ecx_inframe(ecx_portt *port, int idx, int stacknumber)
* @return Workcounter if a frame is found with corresponding index, otherwise
* EC_NOFRAME.
*/
static int ecx_waitinframe_red(ecx_portt *port, int idx, osal_timert *timer)
static int ecx_waitinframe_red(ecx_portt *port, uint8 idx, osal_timert *timer)
{
osal_timert timer2;
int wkc = EC_NOFRAME;
Expand Down Expand Up @@ -646,7 +646,7 @@ static int ecx_waitinframe_red(ecx_portt *port, int idx, osal_timert *timer)
* @return Workcounter if a frame is found with corresponding index, otherwise
* EC_NOFRAME.
*/
int ecx_waitinframe(ecx_portt *port, int idx, int timeout)
int ecx_waitinframe(ecx_portt *port, uint8 idx, int timeout)
{
int wkc;
osal_timert timer;
Expand Down Expand Up @@ -681,7 +681,7 @@ int ecx_waitinframe(ecx_portt *port, int idx, int timeout)
* @param[in] timeout = timeout in us
* @return Workcounter or EC_NOFRAME
*/
int ecx_srconfirm(ecx_portt *port, int idx, int timeout)
int ecx_srconfirm(ecx_portt *port, uint8 idx, int timeout)
{
int wkc = EC_NOFRAME;
osal_timert timer1;
Expand All @@ -706,37 +706,37 @@ int ec_closenic(void)
return ecx_closenic(&ecx_port);
}

int ec_getindex(void)
uint8 ec_getindex(void)
{
return ecx_getindex(&ecx_port);
}

void ec_setbufstat(int idx, int bufstat)
void ec_setbufstat(uint8 idx, int bufstat)
{
ecx_setbufstat(&ecx_port, idx, bufstat);
}

int ec_outframe(int idx, int stacknumber)
int ec_outframe(uint8 idx, int stacknumber)
{
return ecx_outframe(&ecx_port, idx, stacknumber);
}

int ec_outframe_red(int idx)
int ec_outframe_red(uint8 idx)
{
return ecx_outframe_red(&ecx_port, idx);
}

int ec_inframe(int idx, int stacknumber)
int ec_inframe(uint8 idx, int stacknumber)
{
return ecx_inframe(&ecx_port, idx, stacknumber);
}

int ec_waitinframe(int idx, int timeout)
int ec_waitinframe(uint8 idx, int timeout)
{
return ecx_waitinframe(&ecx_port, idx, timeout);
}

int ec_srconfirm(int idx, int timeout)
int ec_srconfirm(uint8 idx, int timeout)
{
return ecx_srconfirm(&ecx_port, idx, timeout);
}
Expand Down
26 changes: 13 additions & 13 deletions oshw/intime/nicdrv.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ typedef struct
/** temporary tx buffer length */
int txbuflength2;
/** last used frame index */
int lastidx;
uint8 lastidx;
/** current redundancy state */
int redstate;
/** pointer to redundancy port and buffers */
Expand All @@ -97,20 +97,20 @@ extern const uint16 secMAC[3];
int ec_setupnic(const char * ifname, int secondary);
int ec_closenic(void);
void ec_setupheader(void *p);
void ec_setbufstat(int idx, int bufstat);
int ec_getindex(void);
int ec_outframe(int idx, int sock);
int ec_outframe_red(int idx);
int ec_waitinframe(int idx, int timeout);
int ec_srconfirm(int idx,int timeout);
void ec_setbufstat(uint8 idx, int bufstat);
uint8 ec_getindex(void);
int ec_outframe(uint8 idx, int sock);
int ec_outframe_red(uint8 idx);
int ec_waitinframe(uint8 idx, int timeout);
int ec_srconfirm(uint8 idx,int timeout);

int ecx_setupnic(ecx_portt *port, const char * ifname, int secondary);
int ecx_closenic(ecx_portt *port);
void ecx_setbufstat(ecx_portt *port, int idx, int bufstat);
int ecx_getindex(ecx_portt *port);
int ecx_outframe(ecx_portt *port, int idx, int sock);
int ecx_outframe_red(ecx_portt *port, int idx);
int ecx_waitinframe(ecx_portt *port, int idx, int timeout);
int ecx_srconfirm(ecx_portt *port, int idx,int timeout);
void ecx_setbufstat(ecx_portt *port, uint8 idx, int bufstat);
uint8 ecx_getindex(ecx_portt *port);
int ecx_outframe(ecx_portt *port, uint8 idx, int sock);
int ecx_outframe_red(ecx_portt *port, uint8 idx);
int ecx_waitinframe(ecx_portt *port, uint8 idx, int timeout);
int ecx_srconfirm(ecx_portt *port, uint8 idx,int timeout);

#endif
Loading

0 comments on commit d9261e8

Please sign in to comment.