libcs compiles with -ansi option now

FossilOrigin-Name: afeca48ac2e33dace533047329ea48224ee5e4bfd4e83449f335d0a022a67215
This commit is contained in:
7u83@mail.ru
2018-03-02 12:36:03 +00:00
parent 8f12f61dbd
commit 14de235c5c
22 changed files with 980 additions and 760 deletions

View File

@ -581,40 +581,15 @@ extern struct cw_strlist_elem mbag_item_strings[];
#define cw_strerror(rc) cw_strrc(rc)
*/
static inline const char * cw_strerror(int rc) {
if (rc<0){
if (errno==EAGAIN)
return "Timed out";
return strerror(errno);
}
return cw_strresult(rc);
}
const char * cw_strerror(int rc);
int cw_rcok(int rc);
const char *cw_strelemp_(cw_strheap_t h, int msg_id);
#define cw_strrc cw_strerror
static inline int cw_rcok(int rc)
{
if (rc==0 || rc==2){
return 1;
}
return 0;
}
/**
*@defgroup CW CW
*@{
*/
static inline const char *cw_strelemp_(cw_strheap_t h, int msg_id)
{
const char *rc = cw_strheap_get(h, msg_id);
if (rc)
return rc;
return cw_strheap_get(h, CW_STR_STOP);
}
/**@}*/
#define cw_strelemp(p,id) cw_strelemp_((p)->strelem,id)