Skip to content

Commit

Permalink
fix some warnings about casts
Browse files Browse the repository at this point in the history
  • Loading branch information
radkesvat committed Apr 3, 2024
1 parent 4a42050 commit cc7c153
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tunnels/logger/logger_tunnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static inline void upStream(tunnel_t *self, context_t *c)
reply->payload = popBuffer(buffer_pools[c->line->tid]);
DISCARD_CONTEXT(c);
destroyContext(c);
sprintf(rawBuf(reply->payload), "%s", "salam");
sprintf((char*)rawBuf(reply->payload), "%s", "salam");
setLen(reply->payload, strlen("salam"));
self->dw->downStream(self->dw, reply);
}
Expand Down Expand Up @@ -97,7 +97,7 @@ static inline void downStream(tunnel_t *self, context_t *c)
{
context_t *reply = newContextFrom(c);
reply->payload = popBuffer(buffer_pools[c->line->tid]);
sprintf(rawBuf(reply->payload), "%s", "salam");
sprintf((char*)rawBuf(reply->payload), "%s", "salam");
setLen(reply->payload, strlen("salam"));
self->up->upStream(self->up, reply);
}
Expand Down
2 changes: 1 addition & 1 deletion ww/shiftbuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ inline void consume(shift_buffer_t *self, size_t bytes)
setLen(self, bufLen(self) - bytes);
}

inline unsigned char *rawBuf(shift_buffer_t *self) {return &(self->pbuf[self->curpos]); }
inline unsigned char *rawBuf(shift_buffer_t *self) {return (unsigned char *)&(self->pbuf[self->curpos]); }



Expand Down

0 comments on commit cc7c153

Please sign in to comment.