2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-22 18:07:40 +00:00

18 Commits

Author SHA1 Message Date
Ben Pfaff
cb22974d77 Replace most uses of assert by ovs_assert.
This is a straight search-and-replace, except that I also removed #include
<assert.h> from each file where there were no assert calls left.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
2013-01-16 16:03:37 -08:00
Ben Pfaff
ebc56baa41 util: New macro CONST_CAST.
Casts are sometimes necessary.  One common reason that they are necessary
is for discarding a "const" qualifier.  However, this can impede
maintenance: if the type of the expression being cast changes, then the
presence of the cast can hide a necessary change in the code that does the
cast.  Using CONST_CAST, instead of a bare cast, makes these changes
visible.

Inspired by my own work elsewhere:
http://git.savannah.gnu.org/cgit/pspp.git/tree/src/libpspp/cast.h#n80

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-08-03 13:33:13 -07:00
Ben Pfaff
06d7ae7d9b dynamic-string: New function ds_get_test_line().
This eliminates some code duplication.   An upcoming commit will add
another user.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-10 11:44:05 -07:00
Raju Subramanian
e0edde6fee Global replace of Nicira Networks.
Replaced all instances of Nicira Networks(, Inc) to Nicira, Inc.

Feature #10593
Signed-off-by: Raju Subramanian <rsubramanian@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-02 17:08:02 -07:00
Ben Pfaff
541bc79f73 dynamic-string: Document a few functions.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-02-27 10:07:47 -08:00
Gurucharan Shetty
b5d29991cc vlog: Change the default timestamp structure.
Change the default timestamp for console and file logs to
UTC in a format that satisfies timestamp requirements in RFC 5424.

Also, add the ability for ovs-appctl to log timestamps in UTC.

Bug #9052.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2012-01-27 16:56:12 -08:00
Ben Pfaff
dd8101bc53 dynamic-string: New function ds_get_preprocessed_line().
This commit adds one user.  It will be useful elsewhere in an upcoming
commit.
2011-03-16 14:53:16 -07:00
Ben Pfaff
2a022368f4 Avoid shadowing local variable names.
All of these changes avoid using the same name for two local variables
within a same function.  None of them are actual bugs as far as I can tell,
but any of them could be confusing to the casual reader.

The one in lib/ovsdb-idl.c is particularly brilliant: inner and outer
loops both using (different) variables named 'i'.

Found with GCC -Wshadow.
2010-09-20 09:39:54 -07:00
Joe Perches
d295e8e97a treewide: Remove trailing whitespace
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
2010-08-30 13:23:08 -07:00
Jesse Gross
c73814a3e6 timeval: Use monotonic time where appropriate.
Most of the timekeeping needs of OVS are simply to measure intervals,
which means that it is sensitive to changes in the clock.  This commit
replaces the existing clocks with monotonic timers.  An additional set
of wall clock timers are added and used in locations that need absolute
time.

Bug #1858
2010-06-08 18:01:25 -07:00
Ben Pfaff
36c501fe78 dynamic-string: Optimize ds_put_char().
A qprof profile showed ds_put_char() and ds_put_uninit() as 4% of total
runtime.  This commit inlines the common case, which reduces them to 1%
total.
2010-05-05 14:00:50 -07:00
Ben Pfaff
e83fd21330 dynamic-string: New function ds_swap(). 2010-01-28 16:06:31 -08:00
Ben Pfaff
5f98eed4eb dynamic-string: New function ds_cstr_ro(). 2009-12-16 11:28:13 -08:00
Ben Pfaff
1fd13cde12 jsonrpc: Add logging for messages sent and received, at DBG level.
This made it much easier to see problems while developing some
ovsdb-server features.
2009-11-17 16:02:46 -08:00
Ben Pfaff
f38b84ea2b Implement JSON parsing and serialization.
This will be used by the upcoming Open vSwitch configuration database.
2009-11-04 15:24:40 -08:00
Ben Pfaff
4871855420 New function ds_steal_cstr(). 2009-07-16 09:17:06 -07:00
Ben Pfaff
a14bc59fb8 Update primary code license to Apache 2.0. 2009-06-15 15:11:30 -07:00
Ben Pfaff
064af42167 Import from old repository commit 61ef2b42a9c4ba8e1600f15bb0236765edc2ad45. 2009-07-08 13:19:16 -07:00