diff options
author | Johannes Hofmann <johannes.hofmann@gmx.de> | 2013-11-24 10:20:45 +0100 |
---|---|---|
committer | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2013-11-24 10:43:35 +0100 |
commit | 1fe0a5f39a8755da4cd16e92f2ea00676d9ee3ca (patch) | |
tree | dfdf117fafff4f2c6268f0a69902e855dc045934 | |
parent | 4435e0ee6791136e641d58ce6cf00f8665fe3065 (diff) | |
download | st-patched-1fe0a5f39a8755da4cd16e92f2ea00676d9ee3ca.tar.bz2 st-patched-1fe0a5f39a8755da4cd16e92f2ea00676d9ee3ca.tar.xz st-patched-1fe0a5f39a8755da4cd16e92f2ea00676d9ee3ca.zip |
Use int instead of long for color
This patch replaces long by int32_t. It saves
some memory on 64bit systems.
-rw-r--r-- | st.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -180,8 +180,8 @@ typedef unsigned short ushort; | |||
180 | typedef struct { | 180 | typedef struct { |
181 | char c[UTF_SIZ]; /* character code */ | 181 | char c[UTF_SIZ]; /* character code */ |
182 | ushort mode; /* attribute flags */ | 182 | ushort mode; /* attribute flags */ |
183 | ulong fg; /* foreground */ | 183 | uint32_t fg; /* foreground */ |
184 | ulong bg; /* background */ | 184 | uint32_t bg; /* background */ |
185 | } Glyph; | 185 | } Glyph; |
186 | 186 | ||
187 | typedef Glyph *Line; | 187 | typedef Glyph *Line; |
@@ -379,7 +379,7 @@ static void tsetdirtattr(int); | |||
379 | static void tsetmode(bool, bool, int *, int); | 379 | static void tsetmode(bool, bool, int *, int); |
380 | static void tfulldirt(void); | 380 | static void tfulldirt(void); |
381 | static void techo(char *, int); | 381 | static void techo(char *, int); |
382 | static long tdefcolor(int *, int *, int); | 382 | static uint32_t tdefcolor(int *, int *, int); |
383 | static void tselcs(void); | 383 | static void tselcs(void); |
384 | static void tdeftran(char); | 384 | static void tdeftran(char); |
385 | static inline bool match(uint, uint); | 385 | static inline bool match(uint, uint); |
@@ -1666,9 +1666,9 @@ tdeleteline(int n) { | |||
1666 | tscrollup(term.c.y, n); | 1666 | tscrollup(term.c.y, n); |
1667 | } | 1667 | } |
1668 | 1668 | ||
1669 | long | 1669 | uint32_t |
1670 | tdefcolor(int *attr, int *npar, int l) { | 1670 | tdefcolor(int *attr, int *npar, int l) { |
1671 | long idx = -1; | 1671 | int32_t idx = -1; |
1672 | uint r, g, b; | 1672 | uint r, g, b; |
1673 | 1673 | ||
1674 | switch (attr[*npar + 1]) { | 1674 | switch (attr[*npar + 1]) { |
@@ -1717,7 +1717,7 @@ tdefcolor(int *attr, int *npar, int l) { | |||
1717 | void | 1717 | void |
1718 | tsetattr(int *attr, int l) { | 1718 | tsetattr(int *attr, int l) { |
1719 | int i; | 1719 | int i; |
1720 | long idx; | 1720 | int32_t idx; |
1721 | 1721 | ||
1722 | for(i = 0; i < l; i++) { | 1722 | for(i = 0; i < l; i++) { |
1723 | switch(attr[i]) { | 1723 | switch(attr[i]) { |