]> granicus.if.org Git - graphviz/commit
cgraph storeFileName: squash warnings when dealing with buffer lengths
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 16 Oct 2022 03:46:03 +0000 (20:46 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 19 Oct 2022 14:44:37 +0000 (07:44 -0700)
commitb89294846e123f62d1377a160b1b4f3836f82da2
treefe4391d212c77d21d94b8d4ea36a3298354a8012
parentf1977912a381a2d518961a5e1a5c4c3a8b8f5eea
cgraph storeFileName: squash warnings when dealing with buffer lengths

This removes the following compiler warnings which were particularly problematic
as they were pointing to the wrong source lines. It is unclear whether this is
due to a Flex bug or the way we are calling Flex.

  ../../lib/cgraph/scan.l: In function ‘storeFileName’:
  ../../lib/cgraph/scan.l:98:28: warning: conversion to ‘size_t’ {aka ‘long
    unsigned int’} from ‘int’ may change the sign of the result
    [-Wsign-conversion]
     98 |     static char* buf;
        |                            ^
  ../../lib/cgraph/scan.l:98:37: warning: conversion to ‘size_t’ {aka ‘long
    unsigned int’} from ‘int’ may change the sign of the result
    [-Wsign-conversion]
     98 |     static char* buf;
        |                                     ^
  ../../lib/cgraph/scan.l: In function ‘ppDirective’:
  ../../lib/cgraph/scan.l:125:29: warning: conversion from ‘long int’ to ‘int’
    may change value [-Wconversion]
    125 |             while (*e && *e != '"') e++;
        |                            ~^~
lib/cgraph/scan.l