]>
granicus.if.org Git - graphviz/log
Matthew Fernandez [Sun, 31 Jul 2022 16:28:47 +0000 (09:28 -0700)]
Pango plugin: remove unused 'NEW'
Matthew Fernandez [Sun, 31 Jul 2022 16:26:41 +0000 (09:26 -0700)]
Pango plugin gv_get_ps_fontlist: postpone 'family_name' allocation
Rather than allocating this upfront and then potentially needing to free it
later, we can use a string view to postpone the allocation to when we know it is
actually needed. This works because the lifetime of the backing memory extends
until the call to `g_free(families)`. This also fixes the lack of allocation
failure checks; instead of `strdup` we now call `strview_str` that gracefully
exits on allocation failure.
Matthew Fernandez [Sun, 31 Jul 2022 16:17:49 +0000 (09:17 -0700)]
Pango plugin get_font_mapping: fix unchecked allocation
Matthew Fernandez [Sun, 31 Jul 2022 16:17:16 +0000 (09:17 -0700)]
Pango plugin gv_get_ps_fontlist: fix unchecked allocation
Matthew Fernandez [Sun, 31 Jul 2022 16:16:12 +0000 (09:16 -0700)]
common genEllipticPath: fix unchecked allocation
Matthew Fernandez [Sun, 31 Jul 2022 16:15:42 +0000 (09:15 -0700)]
common moveTo: fix unchecked allocation
Matthew Fernandez [Sun, 31 Jul 2022 16:14:14 +0000 (09:14 -0700)]
gml2gv nameOf: fix unchecked allocation
Matthew Fernandez [Sun, 31 Jul 2022 16:07:38 +0000 (09:07 -0700)]
gvgen makeTreeGen: fix unchecked allocation
Matthew Fernandez [Sun, 31 Jul 2022 16:06:12 +0000 (09:06 -0700)]
gvgen getCnt: fix unchecked allocation
Matthew Fernandez [Sun, 31 Jul 2022 16:05:37 +0000 (09:05 -0700)]
gvgen mkTree: fix unchecked allocations
Matthew Fernandez [Sun, 31 Jul 2022 16:05:06 +0000 (09:05 -0700)]
gvgen makeTetrix: fix unchecked allocations
Matthew Fernandez [Sun, 31 Jul 2022 16:04:11 +0000 (09:04 -0700)]
gvgen makeSierpinski: fix unchecked allocations
Matthew Fernandez [Sat, 6 Aug 2022 00:58:56 +0000 (00:58 +0000)]
Merge branch 'smattr/
dcb7bc23 -5914-43ae-94d5-
0003feef06b0 ' into 'main'
gvpr: more compiler warning squashing
See merge request graphviz/graphviz!2778
Matthew Fernandez [Wed, 3 Aug 2022 01:37:21 +0000 (18:37 -0700)]
gvpr endString: squash a -Wconversion waning
`c` is known to be '\\' here.
Matthew Fernandez [Wed, 3 Aug 2022 01:34:31 +0000 (18:34 -0700)]
gvpr parseID: simplify loop
Matthew Fernandez [Wed, 3 Aug 2022 01:30:41 +0000 (18:30 -0700)]
gvpr readc: cast to squash -Wconversion warnings
These variables are known to be '\n' here.
Matthew Fernandez [Wed, 3 Aug 2022 01:29:15 +0000 (18:29 -0700)]
gvpr: represent binding count as a size_t
Squashes 3 -Wsign-conversion warnings.
Matthew Fernandez [Wed, 3 Aug 2022 01:16:18 +0000 (18:16 -0700)]
gvpr tvtypeToStr: take a long long instead of int
This function is always called with long long values, so lets match it with its
callers. Squashes 2 -Wconversion warnings.
Matthew Fernandez [Wed, 3 Aug 2022 01:06:11 +0000 (18:06 -0700)]
gvpr binary: remove unnecessary parens
Matthew Fernandez [Wed, 3 Aug 2022 01:04:11 +0000 (18:04 -0700)]
gvpr binary: use local types that corresponds to the values being stored
Squashes 2 -Wconversion warnings.
Matthew Fernandez [Wed, 3 Aug 2022 01:06:50 +0000 (18:06 -0700)]
gvpr validTVT: remove unnecessary parens
Matthew Fernandez [Wed, 3 Aug 2022 01:01:57 +0000 (18:01 -0700)]
gvpr validTVT: return a more appropriate type
Matthew Fernandez [Wed, 3 Aug 2022 00:58:10 +0000 (17:58 -0700)]
gvpr validTVT: take a long long instead of int
This function is always called with long long values, so lets match it with its
callers. Squashes 2 -Wconversion warnings.
Matthew Fernandez [Wed, 3 Aug 2022 00:55:49 +0000 (17:55 -0700)]
gvpr setval: use a local type that corresponds to the value being stored in it
Squashes a -Wconversion warning. This has no effect on functionality because the
`validTVT` call is confirming the value is within the expected range.
Matthew Fernandez [Fri, 5 Aug 2022 15:37:31 +0000 (15:37 +0000)]
Merge branch 'smattr/
91ab2290 -e3c6-4966-93b8-
b1d10a129711 ' into 'main'
pathplan clean up and warning squashing
See merge request graphviz/graphviz!2776
Matthew Fernandez [Sat, 30 Jul 2022 21:47:05 +0000 (14:47 -0700)]
neatogen printvis: remove unnecessary casts
The type of the fields of `pts` can vary between `float` and `double` depending
compile time options, which is what this code was attempting to deal with. But
`float` and `double` are treated identically with respect to `printf`, so there
is no need to cast.
Matthew Fernandez [Sat, 30 Jul 2022 21:45:43 +0000 (14:45 -0700)]
pathplan compVis: remove always-0 parameter
Matthew Fernandez [Sat, 30 Jul 2022 16:56:42 +0000 (09:56 -0700)]
pathplan Pobspath: squash a -Wconversion warning
Here again the proper solution would be to make the struct’s field also a
`size_t` but once again it is part of the public API that we would like to avoid
breaking.
Matthew Fernandez [Sat, 30 Jul 2022 16:50:18 +0000 (09:50 -0700)]
pathplan Pobspath: replace an unchecked array 'malloc' with 'gv_calloc'
This function has no way of reporting failure to the caller. So this turns an
allocation failure from a messy crash into a more graceful exit.
Matthew Fernandez [Sat, 30 Jul 2022 16:47:54 +0000 (09:47 -0700)]
pathplan Pobsopen: call 'calloc' instead of 'malloc' when allocating arrays
This is the generally preferred way of doing this that avoids various pitfalls,
such as integer overflow during multiplication.
Matthew Fernandez [Sat, 30 Jul 2022 16:45:16 +0000 (09:45 -0700)]
pathplan Pobsopen: use a 'size_t' when calling 'malloc'
Squashes a -Wsign-conversion warning and makes explicit a previously implicit
assumption.
Matthew Fernandez [Sat, 30 Jul 2022 16:38:15 +0000 (09:38 -0700)]
pathplan Pobsopen: use a 'size_t' when counting objects
This squashes 3 -Wsign-conversion warnings and is generally closer to what we
would like to do here. The “proper” fix is for fields like `vconfig_t.N` to
become `size_t` instead of `int`. But unfortunately they are part of the public
API, and it seems undesirable to break API for this.
Note that an assumption previously implicit in this function, that all inputs
had a non-negative polygon count, is now an explicit assertion.
Matthew Fernandez [Sat, 30 Jul 2022 16:29:47 +0000 (09:29 -0700)]
pathplan Pobsopen: fix unchecked allocation failures
The first `malloc` of `rv` was checked for failure but the subsequent ones were
assumed to succeed.
Matthew Fernandez [Sat, 30 Jul 2022 16:21:45 +0000 (09:21 -0700)]
pathplan: remove 'mymalloc' wrapper
The calling code does not rely on the semantics of `malloc` returning `NULL`
when called with a 0 size. It unconditionally frees these arrays in `Pobsclose`
so allocations returning a non-`NULL` pointer for 0-sized allocations (which
Glibc typically does) is fine. Maintaining a wrapper that enforces this is
unnecessary.
Matthew Fernandez [Thu, 4 Aug 2022 02:07:58 +0000 (02:07 +0000)]
Merge branch 'smattr/
b76f3f9f -2903-4d65-bbfd-
8ce53a769f47 ' into 'main'
warning squashing and removing unused 'flag' parameters
See merge request graphviz/graphviz!2775
Matthew Fernandez [Sat, 30 Jul 2022 01:17:00 +0000 (18:17 -0700)]
sfdpgen SparseStressMajorizationSmoother_new: remove 'scale_initial_coord' param
This is always set to true.
Matthew Fernandez [Sat, 30 Jul 2022 01:11:26 +0000 (18:11 -0700)]
sfdpgen SparseStressMajorizationSmoother_new: remove inverse distance weighting
This scheme is unused.
Matthew Fernandez [Sat, 30 Jul 2022 01:06:19 +0000 (18:06 -0700)]
gvmap makeMap: remove now unused 'flag' local
Matthew Fernandez [Sat, 30 Jul 2022 01:01:06 +0000 (18:01 -0700)]
gvmap make_map_from_rectangle_groups: remove now unused 'flag' parameter
Matthew Fernandez [Sat, 30 Jul 2022 00:56:38 +0000 (17:56 -0700)]
gvmap make_map_internal: remove 'flag' parameter
This is always set to 0 and conveys no information to the caller.
Matthew Fernandez [Sat, 30 Jul 2022 00:52:12 +0000 (17:52 -0700)]
sparse QuadTree_get_nearest: remove 'flag' parameter
This is always set to 0 and conveys no information to the caller.
Matthew Fernandez [Sat, 30 Jul 2022 00:42:04 +0000 (17:42 -0700)]
sparse QuadTree_get_nearest_internal: remove 'flag' parameter
This is always set to 0 and conveys no information to the caller.
Matthew Fernandez [Sat, 30 Jul 2022 00:39:34 +0000 (17:39 -0700)]
sfdpgen: remove unnecessary casts of 'Operator.data' pointers
Matthew Fernandez [Sat, 30 Jul 2022 00:35:04 +0000 (17:35 -0700)]
sfdpgen SparseMatrix_solve: remove 'flag' parameter
This is always set to 0 and conveys no information to the caller.
Matthew Fernandez [Sat, 30 Jul 2022 00:30:23 +0000 (17:30 -0700)]
sfdpgen SparseMatrix_solve: remove unused Jacobi matrix solving
This also removes the `method` parameter to this function, which was only ever
set to a single value. This squashes 8 compiler warnings and drops a lot of dead
code.
Matthew Fernandez [Sat, 30 Jul 2022 00:07:17 +0000 (17:07 -0700)]
neatogen constrained_majorization_vpsc: s/fabs/fabsf when dealing with floats
This squashes a -Wfloat-conversion warning.
Matthew Fernandez [Sat, 30 Jul 2022 00:05:50 +0000 (17:05 -0700)]
neatogen stress_majorization_cola: remove unused 'nedges_graph' parameter
Matthew Fernandez [Sat, 30 Jul 2022 00:24:05 +0000 (17:24 -0700)]
neatogen tweakEnd: remove unused 'pl' parameter
Matthew Fernandez [Sat, 30 Jul 2022 00:24:05 +0000 (17:24 -0700)]
neatogen addTriEdge: remove unused 'd' parameter
This function was ignoring the parameter and calculating the edge distance
itself internally.
Matthew Fernandez [Wed, 3 Aug 2022 02:57:42 +0000 (02:57 +0000)]
Merge branch 'point-test-doc' into 'main'
pointset: doxygen comments
See merge request graphviz/graphviz!2700
Costa Shulyupin [Wed, 3 Aug 2022 02:57:41 +0000 (02:57 +0000)]
pointset: doxygen comments
Matthew Fernandez [Wed, 3 Aug 2022 01:22:37 +0000 (01:22 +0000)]
Merge branch 'partition-doc' into 'main'
partition.h: add doxygen comments
See merge request graphviz/graphviz!2707
Costa Shulyupin [Sat, 28 May 2022 04:11:52 +0000 (07:11 +0300)]
partition.h: add doxygen comments
Costa Shulyupin [Sat, 28 May 2022 04:13:06 +0000 (07:13 +0300)]
partition.h: add names of arguments
and remove by the way redundant `extern`
Matthew Fernandez [Tue, 2 Aug 2022 05:31:31 +0000 (05:31 +0000)]
Merge branch 'smattr/
312b41d1 -07fa-4afd-911f-
b761fdd0d6db ' into 'main'
gvpr warning squashing
See merge request graphviz/graphviz!2774
Matthew Fernandez [Thu, 28 Jul 2022 02:21:45 +0000 (19:21 -0700)]
gvpr canontoken: use char instead of unsigned char, introduce casts
It is not clear to me why this code was using unsigned char when it can do the
same thing with less typing and fewer compiler warnings using char. This also
introduces casts to squash warnings from some of the more pedantic compiler
implementations. See
6c29170f9f29466374fbc6e8e62a1b6916c6bc59 for details.
Matthew Fernandez [Thu, 28 Jul 2022 02:17:37 +0000 (19:17 -0700)]
gvpr canontoken: remove commented out code
Matthew Fernandez [Thu, 28 Jul 2022 02:13:15 +0000 (19:13 -0700)]
gvpr readLine: squash -Wconversion warnings
`c` is guaranteed to fit in a char here.
Matthew Fernandez [Thu, 28 Jul 2022 02:11:31 +0000 (19:11 -0700)]
gvpr freadFile: squash a -Wsign-compare warning
Matthew Fernandez [Thu, 28 Jul 2022 02:11:01 +0000 (19:11 -0700)]
gvpr fwriteFile: squash a -Wsign-compare warning
Matthew Fernandez [Thu, 28 Jul 2022 02:08:38 +0000 (19:08 -0700)]
gvpr cloneO: squash a -Wswitch-default warning
This switch is exhaustive.
Matthew Fernandez [Thu, 28 Jul 2022 02:07:24 +0000 (19:07 -0700)]
gvpr copy: squash a -Wswitch-default warning
This switch is exhaustive.
Matthew Fernandez [Thu, 28 Jul 2022 02:05:51 +0000 (19:05 -0700)]
gvpr rindexOf: return a long instead of int
The only use of this function stores the return value in a long, so lets just
return a long, squashing two compiler warnings.
Matthew Fernandez [Thu, 28 Jul 2022 01:58:25 +0000 (18:58 -0700)]
gvpr cmppair: squash -Wunused-parameter warnings
This function is used as a callback, so cannot easily have these unused
parameters removed.
Matthew Fernandez [Sat, 30 Jul 2022 00:56:20 +0000 (00:56 +0000)]
Merge branch 'smattr/
a2930eb8 -ba18-4789-bf34-
93446083513e ' into 'main'
lib/ast warning squashing and simplification
See merge request graphviz/graphviz!2773
Matthew Fernandez [Sun, 24 Jul 2022 18:06:48 +0000 (11:06 -0700)]
ast onematch: simplify string comparisons by using string views
Matthew Fernandez [Sun, 24 Jul 2022 17:49:39 +0000 (10:49 -0700)]
ast onematch: fuse comparison against 'xdigi' and 't'
Freed of the limitations of hash function in the previous commit, we can express
this as a single comparison.
Matthew Fernandez [Sun, 24 Jul 2022 17:44:09 +0000 (10:44 -0700)]
ast onematch: rephrase hash-based switch into string comparisons
This code was using a hand rolled hash function to implement a series of string
comparisons as a jump table. I guess at some point this must have been a
necessary optimization due to limitations of the day’s compilers/machines. In a
modern environment, this is a deoptimization, impeding the compiler’s ability to
understand your intent. Modern compilers know the string comparison functions as
built-ins and can use SIMD¹/SWAR² tricks to emit a short string comparison as a
single instruction. They are also capable of transforming an if-then-else ladder
into a switch if their heuristics predict it will be worthwhile.
¹ https://en.wikipedia.org/wiki/Single_instruction,_multiple_data
² https://en.wikipedia.org/wiki/SWAR
Matthew Fernandez [Sun, 24 Jul 2022 17:18:40 +0000 (10:18 -0700)]
ast gobble: squash -Wswitch-default warning
Matthew Fernandez [Sun, 24 Jul 2022 17:17:53 +0000 (10:17 -0700)]
ast strmatch: squash -Wundef warnings
Matthew Fernandez [Sun, 24 Jul 2022 17:07:01 +0000 (10:07 -0700)]
ast stresc: squash -Wswitch-default warning
Matthew Fernandez [Sun, 24 Jul 2022 17:05:08 +0000 (10:05 -0700)]
ast stresc: remove return value
The computation of the return value for this function was relying on string
lengths that fitted in an `int`, something that is generally but not always
true. The compiler complained about this with -Wconversion. The only caller of
this function does not use the return value, so lets just remove it.
Matthew Fernandez [Sun, 24 Jul 2022 16:59:13 +0000 (09:59 -0700)]
ast: prototype 'pathcanon' in library header instead of inline near its use
This squashes a -Wmissing-prototypes, is better style, and is generally inline
with the rest of lib/ast.
Matthew Fernandez [Sun, 24 Jul 2022 16:55:56 +0000 (09:55 -0700)]
ast fmtbuf: squash -Wsign-compare warning
This is computing the number of bytes remaining in `buf`; the number of bytes
between a pointer to the current offset and the end of `buf`. Thus it is always
non-negative.
Matthew Fernandez [Sun, 24 Jul 2022 16:54:52 +0000 (09:54 -0700)]
ast chrtoi: squash -Wswitch-default warning
Matthew Fernandez [Sun, 24 Jul 2022 16:51:29 +0000 (09:51 -0700)]
ast chrtoi: remove unnecessary cast
Matthew Fernandez [Sun, 24 Jul 2022 16:50:50 +0000 (09:50 -0700)]
ast chrtoi: squash -Wsign-compare warning
Matthew Fernandez [Fri, 29 Jul 2022 01:48:27 +0000 (01:48 +0000)]
Merge branch 'smattr/
f2b32419 -4ad7-4884-83ff-
cc27d7a0667f ' into 'main'
sfdpgen warning squashing
See merge request graphviz/graphviz!2772
Matthew Fernandez [Sat, 23 Jul 2022 15:42:22 +0000 (08:42 -0700)]
sfdpgen: remove unimplemented 'DistanceMatrix_restrict_filtering'
Matthew Fernandez [Sat, 23 Jul 2022 15:39:08 +0000 (08:39 -0700)]
sfdpgen maximal_…: remove unused 'randomize' parameter
Matthew Fernandez [Sat, 23 Jul 2022 15:34:37 +0000 (08:34 -0700)]
sfdpgen: make 'UniformStressSmoother_new' a static function
This function is not used outside of its containing file.
Matthew Fernandez [Sat, 23 Jul 2022 15:33:57 +0000 (08:33 -0700)]
sfdpgen UniformStressSmoother_new: remove unused 'flag' parameter
Matthew Fernandez [Sat, 23 Jul 2022 15:33:02 +0000 (08:33 -0700)]
sfdpgen UniformStressSmoother_new: remove unused 'x' parameter
Matthew Fernandez [Sat, 23 Jul 2022 15:31:47 +0000 (08:31 -0700)]
sfdpgen UniformStressSmoother_new: remove unused 'dim' parameter
Matthew Fernandez [Sat, 23 Jul 2022 15:27:30 +0000 (08:27 -0700)]
sfdpgen stress_model: remove unused 'A' parameter
Matthew Fernandez [Sat, 23 Jul 2022 15:22:58 +0000 (08:22 -0700)]
sfdpgen: make 'get_stress' static
This function is unused outside of its containing file and is only used when
`DEBUG_PRINT` is defined.
Matthew Fernandez [Sat, 23 Jul 2022 15:21:28 +0000 (08:21 -0700)]
sfdpgen get_stress: remove 'weighted' parameter that is always 1
Matthew Fernandez [Sat, 23 Jul 2022 15:20:17 +0000 (08:20 -0700)]
sfdpgen get_stress: remove unused 'data' parameter
Matthew Fernandez [Sat, 23 Jul 2022 15:18:15 +0000 (08:18 -0700)]
sfdpgen jacobi: remove unused 'flag' parameter
Matthew Fernandez [Thu, 28 Jul 2022 02:47:23 +0000 (02:47 +0000)]
Merge branch 'smattr/
45dc48f2 -fa91-42ed-8530-
8bcaf9fdb303 ' into 'main'
neatogen compiler warning squashing
See merge request graphviz/graphviz!2771
Matthew Fernandez [Sat, 23 Jul 2022 01:16:47 +0000 (18:16 -0700)]
neatogen call_tri: remove unused 'dim' parameter
Matthew Fernandez [Sat, 23 Jul 2022 01:10:55 +0000 (18:10 -0700)]
neatogen CMDS_orthog: remove unused 'g' parameter
Matthew Fernandez [Sat, 23 Jul 2022 01:06:16 +0000 (18:06 -0700)]
neatogen constrained_majorization_new_with_gaps: remove unused 'ndim' parameter
Note that the call to this function from
`constrained_majorization_new_with_gaps` also seems confused about the meaning
of its parameters. But no attempt is made to correct this.
Matthew Fernandez [Sat, 23 Jul 2022 01:03:59 +0000 (18:03 -0700)]
neatogen: remove unused 'constrained_majorization_gradient_projection'
This function has seemingly never been used.
Matthew Fernandez [Sat, 23 Jul 2022 00:56:25 +0000 (17:56 -0700)]
neatogen computeHierarchyBoundaries: remove unused 'n' parameter
Matthew Fernandez [Sat, 23 Jul 2022 00:45:45 +0000 (17:45 -0700)]
neatogen mkConstraintG: remove unused 'g' parameter
Matthew Fernandez [Sat, 23 Jul 2022 00:40:26 +0000 (17:40 -0700)]
neatogen bfs_bounded: remove unused 'n' parameter
Matthew Fernandez [Sat, 23 Jul 2022 00:32:16 +0000 (17:32 -0700)]
neatogen initLayout: remove unused 'graph' parameter
Matthew Fernandez [Sat, 23 Jul 2022 00:29:56 +0000 (17:29 -0700)]
neatogen voronoi: remove unused 'triangulate' parameter
Matthew Fernandez [Wed, 27 Jul 2022 15:32:13 +0000 (15:32 +0000)]
Merge branch 'smattr/
5fa804c5 -668e-4a54-b373-
00bc933032d5 ' into 'main'
more compiler warning squashing
See merge request graphviz/graphviz!2770