Skip to content

Commit

Permalink
remove minor code smell
Browse files Browse the repository at this point in the history
  • Loading branch information
etodanik committed Mar 14, 2024
1 parent 6f67402 commit f6c3724
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pshmbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ p_shm_buffer_read (PShmBuffer *buf,
psize write_pos;
psize data_aval;
psize to_copy;
puint i;
psize start_pos;
ppointer addr;

if (P_UNLIKELY (buf == NULL || storage == NULL || len == 0)) {
Expand Down Expand Up @@ -193,7 +193,7 @@ p_shm_buffer_read (PShmBuffer *buf,
data_aval = pp_shm_buffer_get_used_space (buf);
to_copy = (data_aval <= len) ? data_aval : len;

int start_pos = read_pos % buf->size;
start_pos = read_pos % buf->size;

if (start_pos + to_copy <= buf->size)
{
Expand Down Expand Up @@ -223,7 +223,7 @@ p_shm_buffer_write (PShmBuffer *buf,
{
psize read_pos;
psize write_pos;
puint i;
psize start_pos;
ppointer addr;

if (P_UNLIKELY (buf == NULL || data == NULL || len == 0)) {
Expand Down Expand Up @@ -255,7 +255,7 @@ p_shm_buffer_write (PShmBuffer *buf,
return 0;
}

int start_pos = write_pos % buf->size;
start_pos = write_pos % buf->size;

if (start_pos + len <= buf->size)
{
Expand Down

0 comments on commit f6c3724

Please sign in to comment.