aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Hofmann <johannes.hofmann@gmx.de>2013-11-24 10:20:45 +0100
committerRoberto E. Vargas Caballero <k0ga@shike2.com>2013-11-24 10:43:35 +0100
commit1fe0a5f39a8755da4cd16e92f2ea00676d9ee3ca (patch)
treedfdf117fafff4f2c6268f0a69902e855dc045934
parent4435e0ee6791136e641d58ce6cf00f8665fe3065 (diff)
downloadst-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.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/st.c b/st.c
index ee8dc94..fb084b1 100644
--- a/st.c
+++ b/st.c
@@ -180,8 +180,8 @@ typedef unsigned short ushort;
180typedef struct { 180typedef 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
187typedef Glyph *Line; 187typedef Glyph *Line;
@@ -379,7 +379,7 @@ static void tsetdirtattr(int);
379static void tsetmode(bool, bool, int *, int); 379static void tsetmode(bool, bool, int *, int);
380static void tfulldirt(void); 380static void tfulldirt(void);
381static void techo(char *, int); 381static void techo(char *, int);
382static long tdefcolor(int *, int *, int); 382static uint32_t tdefcolor(int *, int *, int);
383static void tselcs(void); 383static void tselcs(void);
384static void tdeftran(char); 384static void tdeftran(char);
385static inline bool match(uint, uint); 385static 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
1669long 1669uint32_t
1670tdefcolor(int *attr, int *npar, int l) { 1670tdefcolor(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) {
1717void 1717void
1718tsetattr(int *attr, int l) { 1718tsetattr(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]) {