Remove long_u: hardcopy: Refactor long_u.

- <color_related_stuff>: long_u --> uint32_t

  Everywhere long_u was used to hold a color value.
  Color values are supposed to be 32 bits at most.
  Supported architectures have 32 bits ints, so we could have used plain
  ints. But this wouldn't be future-proof, and would be wasteful if a
  future architecture has ints bigger than 32 bits.
  So, uint32_t is perfect to achieve optimal packing no matter the
  architecture.

- bytes_to_print/bytes_printed: long_u --> size_t

  Seems like the correct thing, and gets rid of some casts.
This commit is contained in:
Eliseo Martínez
2015-01-09 14:52:31 +01:00
parent ed8fbfaf5a
commit 2b93edde93
2 changed files with 40 additions and 41 deletions

View File

@@ -1,12 +1,14 @@
#ifndef NVIM_HARDCOPY_H
#define NVIM_HARDCOPY_H
#include <stdint.h>
/*
* Structure to hold printing color and font attributes.
*/
typedef struct {
long_u fg_color;
long_u bg_color;
uint32_t fg_color;
uint32_t bg_color;
int bold;
int italic;
int underline;