The indirection of the data through the IAT is implicitly handled by
modern linkers and compilers when the data symbol is annotated with
`__declspec(dll{import,export})`. This removes the support for the
older toolchains as part of the work to properly annotate symbols for
improvements to the Windows port.
Commit 894e94c66340187ff6f8ea97c9336ea048a3d6ad applied a performance
optimization to gvprintdouble that was contributing to a performance issue in a
user’s graph. The code touched in this commit has the same pattern as that in
gvprintdouble, and the same corresponding (latent) performance issue. While it
is not known to cause any problems currently, we may as well proactively apply
the same optimization here.
This preserves the same functionality, but simply takes an early exit from the
function when we already know precisely how to print the resulting string.
Magnus Jacobsson [Mon, 19 Apr 2021 20:35:42 +0000 (22:35 +0200)]
Correct MSVC storage-class in gvpr.h. Removes one warning
Only set __declspec(dllexport) or __declspec(dllimport) when the gvpr
library is dynamically linked. This is defined by GVDLL which is set
in the Windows MSBuild builds which use dynamic linking, but unset in
the Windows CMake builds which use static linking.
Removes the following warning from the Windows CMake builds:
Magnus Jacobsson [Mon, 19 Apr 2021 19:21:55 +0000 (21:21 +0200)]
Correct MSVC storage-class in geomprocs.h. Removes 19 warnings
Avoid setting __declspec(dllimport) when gvc is being exported.
Removes the following warnings from the Windows CMake builds:
C:\Users\magja\graphviz\lib\common\geom.c(20,1): warning C4273: 'mkbox': inconsistent dll linkage [C:\Users\magja\graphviz\build\lib\common\common_obj.vcxproj]
C:\Users\magja\graphviz\lib\common\geom.c(41,1): warning C4273: 'mkboxf': inconsistent dll linkage [C:\Users\magja\graphviz\build\lib\common\common_obj.vcxproj]
C:\Users\magja\graphviz\lib\common\geom.c(84,1): warning C4273: 'lineToBox': inconsistent dll linkage [C:\Users\magja\graphviz\build\lib\common\common_obj.vcxproj]
C:\Users\magja\graphviz\lib\common\geom.c(194,1): warning C4273: 'rect2poly': inconsistent dll linkage [C:\Users\magja\graphviz\build\lib\common\common_obj.vcxproj]
C:\Users\magja\graphviz\lib\common\geom.c(229,1): warning C4273: 'cwrotatep': inconsistent dll linkage [C:\Users\magja\graphviz\build\lib\common\common_obj.vcxproj]
C:\Users\magja\graphviz\lib\common\geom.c(257,1): warning C4273: 'cwrotatepf': inconsistent dll linkage [C:\Users\magja\graphviz\build\lib\common\common_obj.vcxproj]
C:\Users\magja\graphviz\lib\common\geom.c(285,1): warning C4273: 'ccwrotatep': inconsistent dll linkage [C:\Users\magja\graphviz\build\lib\common\common_obj.vcxproj]
C:\Users\magja\graphviz\lib\common\geom.c(313,1): warning C4273: 'ccwrotatepf': inconsistent dll linkage [C:\Users\magja\graphviz\build\lib\common\common_obj.vcxproj]
C:\Users\magja\graphviz\lib\common\geom.c(341,1): warning C4273: 'flip_rec_box': inconsistent dll linkage [C:\Users\magja\graphviz\build\lib\common\common_obj.vcxproj]
C:\Users\magja\graphviz\lib\common\geom.c(357,1): warning C4273: 'flip_rec_boxf': inconsistent dll linkage [C:\Users\magja\graphviz\build\lib\common\common_obj.vcxproj]
C:\Users\magja\graphviz\lib\common\geom.c(378,1): warning C4273: 'ptToLine2': inconsistent dll linkage [C:\Users\magja\graphviz\build\lib\common\common_obj.vcxproj]
C:\Users\magja\graphviz\lib\common\geom.c(395,1): warning C4273: 'line_intersect': inconsistent dll linkage [C:\Users\magja\graphviz\build\lib\common\common_obj.vcxproj]
LINK : warning LNK4217: symbol 'ptToLine2' defined in 'geom.obj' is imported by 'emit.obj' in function 'check_control_points' [C:\Users\magja\graphviz\build\lib\gvc\gvc.vcxproj]
LINK : warning LNK4217: symbol 'rect2poly' defined in 'geom.obj' is imported by 'emit.obj' in function 'emit_map_rect' [C:\Users\magja\graphviz\build\lib\gvc\gvc.vcxproj]
LINK : warning LNK4217: symbol 'ccwrotatepf' defined in 'geom.obj' is imported by 'postproc.obj' in function 'gv_postprocess' [C:\Users\magja\graphviz\build\lib\gvc\gvc.vcxproj]
LINK : warning LNK4286: symbol 'ccwrotatepf' defined in 'geom.obj' is imported by 'shapes.obj' [C:\Users\magja\graphviz\build\lib\gvc\gvc.vcxproj]
LINK : warning LNK4217: symbol 'flip_rec_boxf' defined in 'geom.obj' is imported by 'shapes.obj' in function 'record_path' [C:\Users\magja\graphviz\build\lib\gvc\gvc.vcxproj]
LINK : warning LNK4217: symbol 'cwrotatepf' defined in 'geom.obj' is imported by 'shapes.obj' in function 'compassPoint' [C:\Users\magja\graphviz\build\lib\gvc\gvc.vcxproj]
LINK : warning LNK4217: symbol 'lineToBox' defined in 'geom.obj' is imported by 'utils.obj' in function 'overlap_bezier' [C:\Users\magja\graphviz\build\lib\gvc\gvc.vcxproj]
replace use of grep in Windows build utility setup with Select-String
This is a built-in function in PowerShell with equivalent functionality for this
purpose. This change is a step towards removing grep as a build dependency on
Windows. Related to #2069.
use isEmpty in preference to checking length against 0 in gvedit
Qt QStrings have two methods, isEmpty and length, analogous to empty and length
on std::string, respectively. Checking isEmpty is equivalent to checking length
against 0, is clearer, and has the potential to be more performant.
Graphviz was part of a closed beta program for Gitlab macOS CI runners.¹ During
the beta period, Graphviz had access to a single macOS VM environment that was
stateful. That is, the effects of any macOS CI task would persist to the next
macOS CI task. To work around this, logic was introduced to manually remove the
Graphviz installed in the macOS CI environment by the prior run.
The Gitlab program will transition into open beta on 2021-05-22, however the
Graphviz configuration was already migrated to the open beta model on
2021-04-07.² This means the macOS runner are no longer stateful:
To recap, for the closed beta, we provisioned a static macOS virtual machine
for each project. This meant that we executed any pipeline job in your
associated repository on the same virtual machine each time. Since the VM was
dedicated to your project, this also meant that your pipeline job did not have
to wait in a queue before running.
For the open-beta, each job that requires a macOS build environment will run
in its own ephemeral virtual machine provisioned on demand by the GitLab
Runner macOS autoscaler. This means that you can’t rely on persistent storage
anymore.
If we need -0.1 and -0.2 as floats (or the closest representation), we should
just say so. This improves the compiler’s ability to understand the intent of
this code.
Instead of being vague with ints, doubles, and floats, this commit standardizes
on float literals in hsv2rgb. This squashes a number of -Wfloat-conversion
compiler warnings.
use floating point math functions to squash a -Wfloat-conversion warning
The function sqrt operates on doubles, which was triggering a -Wfloat-conversion
compiler warning. The float version of this function is sqrtf, but we can
further abbreviate this operation by observing it is computing the hypotenuse of
a right-angled triangle and use the library function for that instead.
With -Wfloat-conversion, the compiler warns that going via double literals like
this resulted in an imprecise float. To squash this warning and be more precise,
we can use float literals instead.
remove use of double literals with ydelta in make_flat_labeled_edge
Commit ebe7517ae4eb86ee4bf34e1af31a174f1f0a4049 altered these lines to use
double literals instead of integer literals for `5` and `6`. It is not clear why
it did this as ydelta is an integer variable. The effect of that change was to
ask the compiler to perform the computation itself using doubles and then reduce
it to an integer result. This commit reverts that part of the diff to simply use
integer computation throughout. This change was motivated by the compiler
diagnosing this issue with -Wfloat-conversion.
squash a -Wfloat-conversion due to sqrt in distBetweenPts
There is a dedicated libc function for doing square root of floats, but this
code was incorrectly calling the version for doubles instead. This updated code
is more appropriate and could even be more efficient.
This change avoids some micro-optimizations that were unnecessary and making
this function harder to read. The function’s behavior is intended to be
identical after this change.
fix: remove dangling reference to textfont.* in Autotools file
The file textfont.c was renamed to textspan.c in 65f337664d177b588c5c2418fe12bac7eef62c2a but this rule was incorrectly not
updated. Rather than relying on manual dependencies which the Autotools docs
suggest can be problematic,¹ we just remove this rule. This removes the ability
to `make textspan.o`, but clearly no one was relying on this anyway as it has
been broken since 2013.
The Docker push jobs were depending on all prior jobs which was overly
restrictive. Each push job only needs the image it itself needs to push. Closes
#1988.
squash -Wshadow warning in Import_coord_clusters_from_dot
Similar to a prior change, there was a nested variable also called sz. By
removing this sz, we not only squash a compiler warning but make the code more
readable.