summaryrefslogtreecommitdiff
path: root/top.h
diff options
context:
space:
mode:
authoralbert <>2002-12-08 22:51:09 +0000
committeralbert <>2002-12-08 22:51:09 +0000
commitdc5cb1da28d4be8e7c8e4620533f3352fb0a92c1 (patch)
tree867412547041ff1d8a155640dc42a6faa464fd90 /top.h
parent6e83c7ed6e20ef5ec6619e39581625677049ac83 (diff)
downloadprocps-ng-dc5cb1da28d4be8e7c8e4620533f3352fb0a92c1.tar.gz
likely to improve performance
Diffstat (limited to 'top.h')
-rw-r--r--top.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/top.h b/top.h
index 49a514a..ab04c19 100644
--- a/top.h
+++ b/top.h
@@ -95,13 +95,13 @@
highly optimized to save them ol' precious cycles! */
#define SCB_NUM1(f,n) \
static int sort_ ## f (const proc_t **P, const proc_t **Q) { \
- if ( (*P)->n < (*Q)->n ) return SORT_lt; \
- if ( (*P)->n > (*Q)->n ) return SORT_gt; \
+ if ( (*P)->n < (*Q)->n ) return SORT_lt; \
+ if (likely( (*P)->n > (*Q)->n )) return SORT_gt; \
return SORT_eq; }
#define SCB_NUM2(f,n1,n2) \
static int sort_ ## f (const proc_t **P, const proc_t **Q) { \
- if ( ((*P)->n1 - (*P)->n2) < ((*Q)->n1 - (*Q)->n2) ) return SORT_lt; \
- if ( ((*P)->n1 - (*P)->n2) > ((*Q)->n1 - (*Q)->n2) ) return SORT_gt; \
+ if ( ((*P)->n1 - (*P)->n2) < ((*Q)->n1 - (*Q)->n2) ) return SORT_lt; \
+ if (likely( ((*P)->n1 - (*P)->n2) > ((*Q)->n1 - (*Q)->n2) )) return SORT_gt; \
return SORT_eq; }
#define SCB_NUMx(f,n) \
static int sort_ ## f (const proc_t **P, const proc_t **Q) { \
@@ -563,7 +563,8 @@ typedef struct WIN_t {
//atic int chin (int ech, char *buf, unsigned cnt);
//atic const char *fmtmk (const char *fmts, ...);
//atic inline char *scat (char *restrict dst, const char *restrict src);
-//atic char *strim (int sp, char *str);
+//atic char *strim_0 (char *str);
+//atic char *strim_1 (char *str);
//atic const char *tg2 (int x, int y);
/*------ Exit/Interrput routines ---------------------------------------*/
//atic void bye_bye (int eno, const char *str);