]> granicus.if.org Git - graphviz/commit
use suffixed literals instead of casts to construct 'GLfloat' values
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 25 Mar 2022 05:13:05 +0000 (22:13 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 26 Mar 2022 18:41:09 +0000 (11:41 -0700)
commitd2584ac80ea391964d2d41daa5feadbea3831453
treefb635dac4820c8a6efad1735233d237dc00a6335
parentb87b673f18d02223f6ebe36a9c038562b34cc3d7
use suffixed literals instead of casts to construct 'GLfloat' values

The `GLfloat` type is 32-bit IEEE-754 floating-point.¹ As of C99, the `float`
type is also 32-bit IEEE-754 floating-point on all platforms with support.² In
contemporary usage, this is effectively all C99 platforms that support
floating-point arithmetic. Graphviz has been compiled in C99 mode since commit
fe3f9411d2c59b463ab1b64eecfd19f2db55d2fc. Putting those things together, we can
abbreviate the way we write `GLfloat` literals, leading to more readable code.

¹ https://www.khronos.org/opengl/wiki/OpenGL_Type
² https://en.wikipedia.org/wiki/C99#IEEE_754_floating-point_support
cmd/smyrna/topfisheyeview.c
lib/glcomp/glcompdefs.h
lib/glcomp/glcompfont.c
lib/glcomp/glcompimage.c
lib/glcomp/glutils.c