diff options
author | Ken Sharp <ken.sharp@artifex.com> | 2018-02-05 15:34:58 +0000 |
---|---|---|
committer | Ken Sharp <ken.sharp@artifex.com> | 2018-02-05 15:34:58 +0000 |
commit | b8e36896913713f46a43dbbc0c0ed83f34ab4f10 (patch) | |
tree | 047d90ee3afd2da50ced8bf7e9719c85908b47a6 /psi/zcolor.c | |
parent | 88e7812d362483d07ce63b47ae75c4852fe01a8f (diff) | |
download | ghostpdl-b8e36896913713f46a43dbbc0c0ed83f34ab4f10.tar.gz |
Try to squash 3 identical scanbuild warnings
I think scanbuild is deciding that 'depth' could be less than 0, leading
us to not enter the loop which assigns 'obj'. This is not true, the
depth cannot be less than 0.
Try making 'depth' an unsigned int as a hint to scanbuild, and see if
the warning goes away.
Diffstat (limited to 'psi/zcolor.c')
-rw-r--r-- | psi/zcolor.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/psi/zcolor.c b/psi/zcolor.c index 625e93366..5215fd720 100644 --- a/psi/zcolor.c +++ b/psi/zcolor.c @@ -5988,11 +5988,12 @@ setcolor_cont(i_ctx_t *i_ctx_p) { ref arr, *parr = &arr; es_ptr ep = esp; - int i=0, code = 0,depth, usealternate, stage, stack_depth, CIESubst = 0, IsICC = 0; + int i=0, code = 0, usealternate, stage, stack_depth, CIESubst = 0, IsICC = 0; + unsigned int depth; PS_colour_space_t *obj; stack_depth = (int)ep[-3].value.intval; - depth = (int)ep[-2].value.intval; + depth = (unsigned int)ep[-2].value.intval; stage = (int)ep[-1].value.intval; /* If we get a continuation from a sub-procedure, we will want to come back * here afterward, to do any remaining spaces. We need to set up for that now. @@ -6073,7 +6074,8 @@ setcolorspace_cont(i_ctx_t *i_ctx_p) ref arr, *parr = &arr; os_ptr op = osp; es_ptr ep = esp, pdepth, pstage, pCIESubst; - int i, code = 0,depth, stage, cont, CIESubst = 0; + int i, code = 0, stage, cont, CIESubst = 0; + unsigned int depth; PS_colour_space_t *obj; pCIESubst = &ep[-3]; @@ -6081,7 +6083,7 @@ setcolorspace_cont(i_ctx_t *i_ctx_p) pstage = &ep[-1]; CIESubst = (int)pCIESubst->value.intval; - depth = (int)pdepth->value.intval; + depth = (unsigned int)pdepth->value.intval; stage = (int)pstage->value.intval; /* If we get a continuation from a sub-procedure, we will want to come back * here afterward, to do any remaining stages. We need to set up for that now. @@ -6380,12 +6382,13 @@ currentbasecolor_cont(i_ctx_t *i_ctx_p) { ref arr, *parr = &arr; es_ptr ep = esp; - int i, code = 0,depth, stage, base, cont=1, stack_depth = 0, CIESubst=0; + int i, code = 0, stage, base, cont=1, stack_depth = 0, CIESubst=0; + unsigned int depth; PS_colour_space_t *obj; stack_depth = (int)ep[-4].value.intval; base = (int)ep[-3].value.intval; - depth = (int)ep[-2].value.intval; + depth = (unsigned int)ep[-2].value.intval; stage = (int)ep[-1].value.intval; /* If we get a continuation from a sub-procedure, we will want to come back * here afterward, to do any remaining stages. We need to set up for that now. |