]> granicus.if.org Git - graphviz/commit
dotgen: squash -Wsign-conversion warnings in 'medians'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 8 May 2022 23:41:17 +0000 (16:41 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 4 Jun 2022 03:37:48 +0000 (20:37 -0700)
commitb7f360b8e3a6275b5a031fd74cc0991d4621a70f
treef97131fa5a42567c14195d7c891f46f96e4766d7
parent4bfff0c196a18bdf9d220741d64432c38c84f6c9
dotgen: squash -Wsign-conversion warnings in 'medians'

The compiler says:

  mincross.c: In function 'medians':
  mincross.c:1803:25: warning: conversion to 'size_t' {aka 'long unsigned int'}
    from 'int' may change the sign of the result [-Wsign-conversion]
   1803 |             qsort(list, j, sizeof(int), (qsort_cmpf) ordercmpf);
        |                         ^

By doing array indexing in this function universally as `size_t` we can avoid
this.
lib/dotgen/mincross.c