summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Warren <ben@skyportsystems.com>2016-04-04 21:32:08 -0400
committerBen Pfaff <blp@ovn.org>2016-04-14 13:48:05 -0700
commitae06a5610a4d5d3fa1d723966aaf356140983f0b (patch)
treed66c030ad65da89faa2a92d5dc6c453f9f8b6a2f /lib
parent064d7f842838bdc41a3b80e49ec92eee19e6e41b (diff)
downloadopenvswitch-ae06a5610a4d5d3fa1d723966aaf356140983f0b.tar.gz
Move lib/type-props.h to include/openvswitch directory
Signed-off-by: Ben Warren <ben@skyportsystems.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/automake.mk1
-rw-r--r--lib/classifier.h2
-rw-r--r--lib/fatal-signal.c2
-rw-r--r--lib/ofp-print.c2
-rw-r--r--lib/ofp-util.c2
-rw-r--r--lib/ofp-util.h2
-rw-r--r--lib/signals.c2
-rw-r--r--lib/signals.h2
-rw-r--r--lib/timeval.h2
-rw-r--r--lib/type-props.h55
-rw-r--r--lib/unaligned.h2
11 files changed, 9 insertions, 65 deletions
diff --git a/lib/automake.mk b/lib/automake.mk
index 015fc860f..cd6043c29 100644
--- a/lib/automake.mk
+++ b/lib/automake.mk
@@ -257,7 +257,6 @@ lib_libopenvswitch_la_SOURCES = \
lib/token-bucket.c \
lib/tun-metadata.c \
lib/tun-metadata.h \
- lib/type-props.h \
lib/unaligned.h \
lib/unicode.c \
lib/unicode.h \
diff --git a/lib/classifier.h b/lib/classifier.h
index d93b82d8e..57a9593e9 100644
--- a/lib/classifier.h
+++ b/lib/classifier.h
@@ -303,7 +303,7 @@
#include "openvswitch/meta-flow.h"
#include "pvector.h"
#include "rculist.h"
-#include "type-props.h"
+#include "openvswitch/type-props.h"
#ifdef __cplusplus
extern "C" {
diff --git a/lib/fatal-signal.c b/lib/fatal-signal.c
index 62acea085..021c8698b 100644
--- a/lib/fatal-signal.c
+++ b/lib/fatal-signal.c
@@ -32,7 +32,7 @@
#include "util.h"
#include "openvswitch/vlog.h"
-#include "type-props.h"
+#include "openvswitch/type-props.h"
#ifndef SIG_ATOMIC_MAX
#define SIG_ATOMIC_MAX TYPE_MAXIMUM(sig_atomic_t)
diff --git a/lib/ofp-print.c b/lib/ofp-print.c
index 9cf6cda66..c38c4f478 100644
--- a/lib/ofp-print.c
+++ b/lib/ofp-print.c
@@ -46,7 +46,7 @@
#include "openvswitch/ofp-errors.h"
#include "packets.h"
#include "dp-packet.h"
-#include "type-props.h"
+#include "openvswitch/type-props.h"
#include "unaligned.h"
#include "odp-util.h"
#include "util.h"
diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index c47b985e9..69ae39cf3 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -44,7 +44,7 @@
#include "random.h"
#include "tun-metadata.h"
#include "unaligned.h"
-#include "type-props.h"
+#include "openvswitch/type-props.h"
#include "openvswitch/ofp-errors.h"
#include "openvswitch/vlog.h"
#include "bitmap.h"
diff --git a/lib/ofp-util.h b/lib/ofp-util.h
index ca36dc4df..2a849ec04 100644
--- a/lib/ofp-util.h
+++ b/lib/ofp-util.h
@@ -30,7 +30,7 @@
#include "openflow/netronome-ext.h"
#include "openflow/nicira-ext.h"
#include "openvswitch/types.h"
-#include "type-props.h"
+#include "openvswitch/type-props.h"
#include "uuid.h"
struct ofpbuf;
diff --git a/lib/signals.c b/lib/signals.c
index 3af618713..36c640b3e 100644
--- a/lib/signals.c
+++ b/lib/signals.c
@@ -23,7 +23,7 @@
#include <unistd.h>
#include "poll-loop.h"
#include "socket-util.h"
-#include "type-props.h"
+#include "openvswitch/type-props.h"
#include "util.h"
#include "openvswitch/vlog.h"
diff --git a/lib/signals.h b/lib/signals.h
index 7017ae815..436f934f8 100644
--- a/lib/signals.h
+++ b/lib/signals.h
@@ -19,7 +19,7 @@
#include <signal.h>
#include <stddef.h>
-#include "type-props.h"
+#include "openvswitch/type-props.h"
enum { SIGNAL_NAME_BUFSIZE = 7 + INT_STRLEN(int) + 1 };
const char *signal_name(int signum, char *namebuf, size_t bufsize);
diff --git a/lib/timeval.h b/lib/timeval.h
index 96b5d089a..7957dadfb 100644
--- a/lib/timeval.h
+++ b/lib/timeval.h
@@ -18,7 +18,7 @@
#define TIMEVAL_H 1
#include <time.h>
-#include "type-props.h"
+#include "openvswitch/type-props.h"
#include "util.h"
#ifdef __cplusplus
diff --git a/lib/type-props.h b/lib/type-props.h
deleted file mode 100644
index e5f4fdcb7..000000000
--- a/lib/type-props.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2008, 2011, 2015 Nicira, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef TYPE_PROPS_H
-#define TYPE_PROPS_H 1
-
-#include <limits.h>
-
-/* True if TYPE is _Bool, false otherwise. */
-#define TYPE_IS_BOOL(TYPE) ((TYPE) 1 == (TYPE) 2)
-
-/* True if TYPE is an integer type (including _Bool), false if it is a
- * floating-point type. */
-#define TYPE_IS_INTEGER(TYPE) ((TYPE) 1.5 == (TYPE) 1)
-
-/* True if TYPE is a signed integer or floating point type, otherwise false. */
-#define TYPE_IS_SIGNED(TYPE) ((TYPE) 1 > (TYPE) -1)
-
-/* The number of value bits in an signed or unsigned integer TYPE:
- *
- * - _Bool has 1 value bit.
- *
- * - An N-bit unsigned integer type has N value bits.
- *
- * - An N-bit signed integer type has N-1 value bits.
- */
-#define TYPE_VALUE_BITS(TYPE) \
- (TYPE_IS_BOOL(TYPE) ? 1 : sizeof(TYPE) * CHAR_BIT - TYPE_IS_SIGNED(TYPE))
-
-/* The minimum or maximum value of a signed or unsigned integer TYPE. */
-#define TYPE_MINIMUM(TYPE) (TYPE_IS_SIGNED(TYPE) ? -TYPE_MAXIMUM(TYPE) - 1 : 0)
-#define TYPE_MAXIMUM(TYPE) \
- ((((TYPE)1 << (TYPE_VALUE_BITS(TYPE) - 1)) - 1) * 2 + 1)
-
-/* Number of decimal digits required to format an integer of the given TYPE.
- * Includes space for a sign, if TYPE is signed, but not for a null
- * terminator.
- *
- * The value is an overestimate. */
-#define INT_STRLEN(TYPE) (TYPE_IS_SIGNED(TYPE) + TYPE_VALUE_BITS(TYPE) / 3 + 1)
-
-#endif /* type-props.h */
diff --git a/lib/unaligned.h b/lib/unaligned.h
index d56f22b2b..130f33790 100644
--- a/lib/unaligned.h
+++ b/lib/unaligned.h
@@ -20,7 +20,7 @@
#include <stdint.h>
#include "byte-order.h"
#include "openvswitch/types.h"
-#include "type-props.h"
+#include "openvswitch/type-props.h"
#include "util.h"
/* Public API. */