summaryrefslogtreecommitdiffstats
path: root/util.c
AgeCommit message (Collapse)AuthorFilesLines
2015-04-07Fix up a handful of integer conversion warningsHEADmasterDan McGee1-1/+1
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2012-02-22Simplify hash functionDan McGee1-1/+1
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2012-01-21Remove unnecessary includesDan McGee1-2/+0
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2011-11-21Fix some faulty timeval related math and comparisonsDan McGee1-0/+10
Add a timeval_positive helper function that doesn't get confused when tv_usec is set to 0 (regardless of the value of tv_sec). Use it wherever possible, and also attempt to reason through our other time value comparison points to ensure all values are being handled correctly, especially those that result in a zero in a field or a zero difference. Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2011-11-20Remove parenthesis around return valuesDan McGee1-9/+9
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2011-11-20Small code cleanupsDan McGee1-1/+1
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2011-11-16Consolidate timeval helper functions into util.cDan McGee1-0/+28
And add a clear macro that saves a bit of verbosity. Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2010-10-22Update copyrightsDan McGee1-1/+1
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2009-05-03hash_sdbm: return 0 if passed NULLDan McGee1-0/+2
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2009-05-02Update copyrightDan McGee1-1/+1
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2009-05-02Remove reimplementation of strdupDan McGee1-20/+0
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2009-04-19Add some stuff to utilDan McGee1-2/+22
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2009-04-12Style fixupDan McGee1-2/+2
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2009-03-28Move sdbm hashing function into util fileDan McGee1-0/+16
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2008-11-17Fix some warnings noticed when compiling with iccDan McGee1-0/+2
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2008-10-05Add an strdup optimizationDan McGee1-2/+7
memcpy is faster with larger blocks; strcpy is faster for smaller. Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2008-10-05More fun changesDan McGee1-0/+66
* Play around with strdup() since it isn't actually part of ISO C. * Get code to compile under c89, c99, and gnu99 * Rework open_listener() to use getaddrinfo() Signed-off-by: Dan McGee <dpmcgee@gmail.com>