diff options
author | Matt Turner <[email protected]> | 2015-11-13 12:13:14 -0800 |
---|---|---|
committer | Matt Turner <[email protected]> | 2015-11-13 12:13:14 -0800 |
commit | 386759b02dac1382072cecef4d6520a0770f995e (patch) | |
tree | b3038b253c2a51cc0d921b431a5f5ff840781f88 /src/mesa | |
parent | 8b145d6a3de381a568d8001131e48257611a542a (diff) |
i965: Silence warning.
intel_asm_annotation.c: In function ‘annotation_insert_error’:
intel_asm_annotation.c:214:18:
warning: ‘ann’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
ann->error = ralloc_strdup(annotation->mem_ctx, error);
^
I initially tried changing the type of ann_count to unsigned (is
currently int), since that in addition to the check that it's non-zero
at the beginning of the function seems sufficient to prove that it must
be greater than zero. Unfortunately that wasn't sufficient.
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_asm_annotation.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_asm_annotation.c b/src/mesa/drivers/dri/i965/intel_asm_annotation.c index 52878fde43e..bb7786ba748 100644 --- a/src/mesa/drivers/dri/i965/intel_asm_annotation.c +++ b/src/mesa/drivers/dri/i965/intel_asm_annotation.c @@ -185,6 +185,8 @@ annotation_insert_error(struct annotation_info *annotation, unsigned offset, if (!annotation_array_ensure_space(annotation)) return; + assume(annotation->ann_count > 0); + for (int i = 0; i < annotation->ann_count; i++) { struct annotation *cur = &annotation->ann[i]; struct annotation *next = &annotation->ann[i + 1]; @@ -206,8 +208,6 @@ annotation_insert_error(struct annotation_info *annotation, unsigned offset, break; } - assume(ann != NULL); - if (ann->error) ralloc_strcat(&ann->error, error); else |