Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libpanel No functional changes



details:   https://anonhg.NetBSD.org/src/rev/dd3c574e7053
branches:  trunk
changeset: 341361:dd3c574e7053
user:      kamil <kamil%NetBSD.org@localhost>
date:      Mon Nov 02 01:06:15 2015 +0000

description:
No functional changes

Make this code nicer for C++ compilers, don't assign char* to void*.
Add extra __prefix_false() CPU hint for failed malloc(3).
Normalize whitespace.

diffstat:

 lib/libpanel/above.c      |   5 ++---
 lib/libpanel/bottom.c     |   5 ++---
 lib/libpanel/del.c        |   5 ++---
 lib/libpanel/hidden.c     |   5 ++---
 lib/libpanel/new.c        |  20 ++++++++++----------
 lib/libpanel/panel.h      |   3 +--
 lib/libpanel/panel_impl.h |   4 ++--
 lib/libpanel/replace.c    |   5 ++---
 lib/libpanel/show.c       |   5 ++---
 lib/libpanel/top.c        |   5 ++---
 lib/libpanel/window.c     |   6 ++----
 11 files changed, 29 insertions(+), 39 deletions(-)

diffs (290 lines):

diff -r b3a90bf56dc2 -r dd3c574e7053 lib/libpanel/above.c
--- a/lib/libpanel/above.c      Mon Nov 02 00:51:18 2015 +0000
+++ b/lib/libpanel/above.c      Mon Nov 02 01:06:15 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: above.c,v 1.2 2015/11/01 01:40:23 uwe Exp $ */
+/*     $NetBSD: above.c,v 1.3 2015/11/02 01:06:15 kamil Exp $ */
 
 /*
  * Copyright (c) 2015 Valery Ushakov
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: above.c,v 1.2 2015/11/01 01:40:23 uwe Exp $");
+__RCSID("$NetBSD: above.c,v 1.3 2015/11/02 01:06:15 kamil Exp $");
 
 #include "panel_impl.h"
 
@@ -34,7 +34,6 @@
 PANEL *
 panel_above(PANEL *p)
 {
-
        if (p == NULL) {
                if (TAILQ_EMPTY(&_deck))
                        return NULL;
diff -r b3a90bf56dc2 -r dd3c574e7053 lib/libpanel/bottom.c
--- a/lib/libpanel/bottom.c     Mon Nov 02 00:51:18 2015 +0000
+++ b/lib/libpanel/bottom.c     Mon Nov 02 01:06:15 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bottom.c,v 1.1 2015/10/26 23:09:49 uwe Exp $ */
+/*     $NetBSD: bottom.c,v 1.2 2015/11/02 01:06:15 kamil Exp $ */
 
 /*
  * Copyright (c) 2015 Valery Ushakov
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: bottom.c,v 1.1 2015/10/26 23:09:49 uwe Exp $");
+__RCSID("$NetBSD: bottom.c,v 1.2 2015/11/02 01:06:15 kamil Exp $");
 
 #include "panel_impl.h"
 
@@ -34,7 +34,6 @@
 int
 bottom_panel(PANEL *p)
 {
-
        if (__predict_false(p == NULL))
                return ERR;
 
diff -r b3a90bf56dc2 -r dd3c574e7053 lib/libpanel/del.c
--- a/lib/libpanel/del.c        Mon Nov 02 00:51:18 2015 +0000
+++ b/lib/libpanel/del.c        Mon Nov 02 01:06:15 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: del.c,v 1.1 2015/10/26 23:09:49 uwe Exp $ */
+/*     $NetBSD: del.c,v 1.2 2015/11/02 01:06:15 kamil Exp $ */
 
 /*
  * Copyright (c) 2015 Valery Ushakov
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: del.c,v 1.1 2015/10/26 23:09:49 uwe Exp $");
+__RCSID("$NetBSD: del.c,v 1.2 2015/11/02 01:06:15 kamil Exp $");
 
 #include "panel_impl.h"
 
@@ -37,7 +37,6 @@
 int
 del_panel(PANEL *p)
 {
-
        if (__predict_false(p == NULL))
                return ERR;
 
diff -r b3a90bf56dc2 -r dd3c574e7053 lib/libpanel/hidden.c
--- a/lib/libpanel/hidden.c     Mon Nov 02 00:51:18 2015 +0000
+++ b/lib/libpanel/hidden.c     Mon Nov 02 01:06:15 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hidden.c,v 1.1 2015/10/26 23:09:49 uwe Exp $ */
+/*     $NetBSD: hidden.c,v 1.2 2015/11/02 01:06:15 kamil Exp $ */
 
 /*
  * Copyright (c) 2015 Valery Ushakov
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: hidden.c,v 1.1 2015/10/26 23:09:49 uwe Exp $");
+__RCSID("$NetBSD: hidden.c,v 1.2 2015/11/02 01:06:15 kamil Exp $");
 
 #include "panel_impl.h"
 
@@ -34,7 +34,6 @@
 int
 panel_hidden(PANEL *p)
 {
-
        if (p == NULL)
                return ERR;
 
diff -r b3a90bf56dc2 -r dd3c574e7053 lib/libpanel/new.c
--- a/lib/libpanel/new.c        Mon Nov 02 00:51:18 2015 +0000
+++ b/lib/libpanel/new.c        Mon Nov 02 01:06:15 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: new.c,v 1.1 2015/10/26 23:09:49 uwe Exp $ */
+/*     $NetBSD: new.c,v 1.2 2015/11/02 01:06:15 kamil Exp $ */
 
 /*
  * Copyright (c) 2015 Valery Ushakov
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: new.c,v 1.1 2015/10/26 23:09:49 uwe Exp $");
+__RCSID("$NetBSD: new.c,v 1.2 2015/11/02 01:06:15 kamil Exp $");
 
 #include "panel_impl.h"
 
@@ -37,17 +37,17 @@
 static PANEL *
 _new_panel(WINDOW *w)
 {
-    PANEL *p;
+       PANEL *p;
 
-    p = (PANEL *)malloc(sizeof(PANEL));
-    if (p == NULL)
-       return NULL;
+       p = (PANEL *)malloc(sizeof(PANEL));
+       if (__predict_false(p == NULL))
+               return NULL;
 
-    p->win = w;
-    p->user = NULL;
+       p->win = w;
+       p->user = NULL;
 
-    DECK_INSERT_TOP(p);
-    return p;
+       DECK_INSERT_TOP(p);
+       return p;
 }
 
 
diff -r b3a90bf56dc2 -r dd3c574e7053 lib/libpanel/panel.h
--- a/lib/libpanel/panel.h      Mon Nov 02 00:51:18 2015 +0000
+++ b/lib/libpanel/panel.h      Mon Nov 02 01:06:15 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: panel.h,v 1.1 2015/10/26 23:09:49 uwe Exp $ */
+/*     $NetBSD: panel.h,v 1.2 2015/11/02 01:06:15 kamil Exp $ */
 
 /*
  * Copyright (c) 2015 Valery Ushakov
@@ -34,7 +34,6 @@
 typedef struct __panel PANEL;
 
 __BEGIN_DECLS
-
 PANEL  *new_panel(WINDOW *);
 int     del_panel(PANEL *);
 
diff -r b3a90bf56dc2 -r dd3c574e7053 lib/libpanel/panel_impl.h
--- a/lib/libpanel/panel_impl.h Mon Nov 02 00:51:18 2015 +0000
+++ b/lib/libpanel/panel_impl.h Mon Nov 02 01:06:15 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: panel_impl.h,v 1.1 2015/10/26 23:09:49 uwe Exp $ */
+/*     $NetBSD: panel_impl.h,v 1.2 2015/11/02 01:06:15 kamil Exp $ */
 
 /*
  * Copyright (c) 2015 Valery Ushakov
@@ -42,7 +42,7 @@
  */
 struct __panel {
        WINDOW *win;
-       void *user;
+       char *user;
        DECK_ENTRY zorder;
 };
 
diff -r b3a90bf56dc2 -r dd3c574e7053 lib/libpanel/replace.c
--- a/lib/libpanel/replace.c    Mon Nov 02 00:51:18 2015 +0000
+++ b/lib/libpanel/replace.c    Mon Nov 02 01:06:15 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: replace.c,v 1.1 2015/10/26 23:09:49 uwe Exp $ */
+/*     $NetBSD: replace.c,v 1.2 2015/11/02 01:06:15 kamil Exp $ */
 
 /*
  * Copyright (c) 2015 Valery Ushakov
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: replace.c,v 1.1 2015/10/26 23:09:49 uwe Exp $");
+__RCSID("$NetBSD: replace.c,v 1.2 2015/11/02 01:06:15 kamil Exp $");
 
 #include "panel_impl.h"
 
@@ -34,7 +34,6 @@
 int
 replace_panel(PANEL *p, WINDOW *w)
 {
-
        if (__predict_false(p == NULL || w == NULL))
                return ERR;
 
diff -r b3a90bf56dc2 -r dd3c574e7053 lib/libpanel/show.c
--- a/lib/libpanel/show.c       Mon Nov 02 00:51:18 2015 +0000
+++ b/lib/libpanel/show.c       Mon Nov 02 01:06:15 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: show.c,v 1.1 2015/10/26 23:09:49 uwe Exp $ */
+/*     $NetBSD: show.c,v 1.2 2015/11/02 01:06:15 kamil Exp $ */
 
 /*
  * Copyright (c) 2015 Valery Ushakov
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: show.c,v 1.1 2015/10/26 23:09:49 uwe Exp $");
+__RCSID("$NetBSD: show.c,v 1.2 2015/11/02 01:06:15 kamil Exp $");
 
 #include "panel_impl.h"
 
@@ -34,7 +34,6 @@
 int
 show_panel(PANEL *p)
 {
-
        if (__predict_false(p == NULL))
                return ERR;
 
diff -r b3a90bf56dc2 -r dd3c574e7053 lib/libpanel/top.c
--- a/lib/libpanel/top.c        Mon Nov 02 00:51:18 2015 +0000
+++ b/lib/libpanel/top.c        Mon Nov 02 01:06:15 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: top.c,v 1.1 2015/10/26 23:09:49 uwe Exp $ */
+/*     $NetBSD: top.c,v 1.2 2015/11/02 01:06:15 kamil Exp $ */
 
 /*
  * Copyright (c) 2015 Valery Ushakov
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: top.c,v 1.1 2015/10/26 23:09:49 uwe Exp $");
+__RCSID("$NetBSD: top.c,v 1.2 2015/11/02 01:06:15 kamil Exp $");
 
 #include "panel_impl.h"
 
@@ -34,7 +34,6 @@
 int 
 top_panel(PANEL *p)
 {
-
        if (__predict_false(p == NULL))
                return ERR;
 
diff -r b3a90bf56dc2 -r dd3c574e7053 lib/libpanel/window.c
--- a/lib/libpanel/window.c     Mon Nov 02 00:51:18 2015 +0000
+++ b/lib/libpanel/window.c     Mon Nov 02 01:06:15 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: window.c,v 1.1 2015/10/26 23:09:49 uwe Exp $ */
+/*     $NetBSD: window.c,v 1.2 2015/11/02 01:06:15 kamil Exp $ */
 
 /*
  * Copyright (c) 2015 Valery Ushakov
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: window.c,v 1.1 2015/10/26 23:09:49 uwe Exp $");
+__RCSID("$NetBSD: window.c,v 1.2 2015/11/02 01:06:15 kamil Exp $");
 
 #include "panel_impl.h"
 
@@ -34,10 +34,8 @@
 WINDOW *
 panel_window(PANEL *p)
 {
-
        if (p == NULL)
                return NULL;
 
        return p->win;
 }
-



Home | Main Index | Thread Index | Old Index