aboutsummaryrefslogtreecommitdiff
path: root/src/common/torint.h
Commit message (Collapse)AuthorAge
* Merge branch '024_msvc_squashed'Nick Mathewson2013-01-16
|\ | | | | | | | | | | Conflicts: src/or/or.h srcwin32/orconfig.h
| * Define SIZEOF_INTPTR_T when defining replacement intptr_tNick Mathewson2013-01-16
| | | | | | | | Fixes bug 7669
* | Update the copyright date to 201.Nick Mathewson2013-01-16
|/
* Convert all include-guard macros to avoid reserved identifiers.Nick Mathewson2012-10-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In C, we technically aren't supposed to define our own things that start with an underscore. This is a purely machine-generated commit. First, I ran this script on all the headers in src/{common,or,test,tools/*}/*.h : ============================== use strict; my %macros = (); my %skipped = (); FILE: for my $fn (@ARGV) { my $f = $fn; if ($fn !~ /^\.\//) { $f = "./$fn"; } $skipped{$fn} = 0; open(F, $fn); while (<F>) { if (/^#ifndef ([A-Za-z0-9_]+)/) { $macros{$fn} = $1; next FILE; } } } print "#!/usr/bin/perl -w -i -p\n\n"; for my $fn (@ARGV) { if (! exists $macros{$fn}) { print "# No macro known for $fn!\n" if (!$skipped{$fn}); next; } if ($macros{$fn} !~ /_H_?$/) { print "# Weird macro for $fn...\n"; } my $goodmacro = uc $fn; $goodmacro =~ s#.*/##; $goodmacro =~ s#[\/\-\.]#_#g; print "s/(?<![A-Za-z0-9_])$macros{$fn}(?![A-Za-z0-9_])/TOR_${goodmacro}/g;\n" } ============================== It produced the following output, which I then re-ran on those same files: ============================== s/(?<![A-Za-z0-9_])_TOR_ADDRESS_H(?![A-Za-z0-9_])/TOR_ADDRESS_H/g; s/(?<![A-Za-z0-9_])_TOR_AES_H(?![A-Za-z0-9_])/TOR_AES_H/g; s/(?<![A-Za-z0-9_])_TOR_COMPAT_H(?![A-Za-z0-9_])/TOR_COMPAT_H/g; s/(?<![A-Za-z0-9_])_TOR_COMPAT_LIBEVENT_H(?![A-Za-z0-9_])/TOR_COMPAT_LIBEVENT_H/g; s/(?<![A-Za-z0-9_])_TOR_CONTAINER_H(?![A-Za-z0-9_])/TOR_CONTAINER_H/g; s/(?<![A-Za-z0-9_])_TOR_CRYPTO_H(?![A-Za-z0-9_])/TOR_CRYPTO_H/g; s/(?<![A-Za-z0-9_])TOR_DI_OPS_H(?![A-Za-z0-9_])/TOR_DI_OPS_H/g; s/(?<![A-Za-z0-9_])_TOR_MEMAREA_H(?![A-Za-z0-9_])/TOR_MEMAREA_H/g; s/(?<![A-Za-z0-9_])_TOR_MEMPOOL_H(?![A-Za-z0-9_])/TOR_MEMPOOL_H/g; s/(?<![A-Za-z0-9_])TOR_PROCMON_H(?![A-Za-z0-9_])/TOR_PROCMON_H/g; s/(?<![A-Za-z0-9_])_TOR_TORGZIP_H(?![A-Za-z0-9_])/TOR_TORGZIP_H/g; s/(?<![A-Za-z0-9_])_TOR_TORINT_H(?![A-Za-z0-9_])/TOR_TORINT_H/g; s/(?<![A-Za-z0-9_])_TOR_LOG_H(?![A-Za-z0-9_])/TOR_TORLOG_H/g; s/(?<![A-Za-z0-9_])_TOR_TORTLS_H(?![A-Za-z0-9_])/TOR_TORTLS_H/g; s/(?<![A-Za-z0-9_])_TOR_UTIL_H(?![A-Za-z0-9_])/TOR_UTIL_H/g; s/(?<![A-Za-z0-9_])_TOR_BUFFERS_H(?![A-Za-z0-9_])/TOR_BUFFERS_H/g; s/(?<![A-Za-z0-9_])_TOR_CHANNEL_H(?![A-Za-z0-9_])/TOR_CHANNEL_H/g; s/(?<![A-Za-z0-9_])_TOR_CHANNEL_TLS_H(?![A-Za-z0-9_])/TOR_CHANNELTLS_H/g; s/(?<![A-Za-z0-9_])_TOR_CIRCUITBUILD_H(?![A-Za-z0-9_])/TOR_CIRCUITBUILD_H/g; s/(?<![A-Za-z0-9_])_TOR_CIRCUITLIST_H(?![A-Za-z0-9_])/TOR_CIRCUITLIST_H/g; s/(?<![A-Za-z0-9_])_TOR_CIRCUITMUX_EWMA_H(?![A-Za-z0-9_])/TOR_CIRCUITMUX_EWMA_H/g; s/(?<![A-Za-z0-9_])_TOR_CIRCUITMUX_H(?![A-Za-z0-9_])/TOR_CIRCUITMUX_H/g; s/(?<![A-Za-z0-9_])_TOR_CIRCUITUSE_H(?![A-Za-z0-9_])/TOR_CIRCUITUSE_H/g; s/(?<![A-Za-z0-9_])_TOR_COMMAND_H(?![A-Za-z0-9_])/TOR_COMMAND_H/g; s/(?<![A-Za-z0-9_])_TOR_CONFIG_H(?![A-Za-z0-9_])/TOR_CONFIG_H/g; s/(?<![A-Za-z0-9_])TOR_CONFPARSE_H(?![A-Za-z0-9_])/TOR_CONFPARSE_H/g; s/(?<![A-Za-z0-9_])_TOR_CONNECTION_EDGE_H(?![A-Za-z0-9_])/TOR_CONNECTION_EDGE_H/g; s/(?<![A-Za-z0-9_])_TOR_CONNECTION_H(?![A-Za-z0-9_])/TOR_CONNECTION_H/g; s/(?<![A-Za-z0-9_])_TOR_CONNECTION_OR_H(?![A-Za-z0-9_])/TOR_CONNECTION_OR_H/g; s/(?<![A-Za-z0-9_])_TOR_CONTROL_H(?![A-Za-z0-9_])/TOR_CONTROL_H/g; s/(?<![A-Za-z0-9_])_TOR_CPUWORKER_H(?![A-Za-z0-9_])/TOR_CPUWORKER_H/g; s/(?<![A-Za-z0-9_])_TOR_DIRECTORY_H(?![A-Za-z0-9_])/TOR_DIRECTORY_H/g; s/(?<![A-Za-z0-9_])_TOR_DIRSERV_H(?![A-Za-z0-9_])/TOR_DIRSERV_H/g; s/(?<![A-Za-z0-9_])_TOR_DIRVOTE_H(?![A-Za-z0-9_])/TOR_DIRVOTE_H/g; s/(?<![A-Za-z0-9_])_TOR_DNS_H(?![A-Za-z0-9_])/TOR_DNS_H/g; s/(?<![A-Za-z0-9_])_TOR_DNSSERV_H(?![A-Za-z0-9_])/TOR_DNSSERV_H/g; s/(?<![A-Za-z0-9_])TOR_EVENTDNS_TOR_H(?![A-Za-z0-9_])/TOR_EVENTDNS_TOR_H/g; s/(?<![A-Za-z0-9_])_TOR_GEOIP_H(?![A-Za-z0-9_])/TOR_GEOIP_H/g; s/(?<![A-Za-z0-9_])_TOR_HIBERNATE_H(?![A-Za-z0-9_])/TOR_HIBERNATE_H/g; s/(?<![A-Za-z0-9_])_TOR_MAIN_H(?![A-Za-z0-9_])/TOR_MAIN_H/g; s/(?<![A-Za-z0-9_])_TOR_MICRODESC_H(?![A-Za-z0-9_])/TOR_MICRODESC_H/g; s/(?<![A-Za-z0-9_])_TOR_NETWORKSTATUS_H(?![A-Za-z0-9_])/TOR_NETWORKSTATUS_H/g; s/(?<![A-Za-z0-9_])_TOR_NODELIST_H(?![A-Za-z0-9_])/TOR_NODELIST_H/g; s/(?<![A-Za-z0-9_])_TOR_NTMAIN_H(?![A-Za-z0-9_])/TOR_NTMAIN_H/g; s/(?<![A-Za-z0-9_])_TOR_ONION_H(?![A-Za-z0-9_])/TOR_ONION_H/g; s/(?<![A-Za-z0-9_])_TOR_OR_H(?![A-Za-z0-9_])/TOR_OR_H/g; s/(?<![A-Za-z0-9_])_TOR_POLICIES_H(?![A-Za-z0-9_])/TOR_POLICIES_H/g; s/(?<![A-Za-z0-9_])_TOR_REASONS_H(?![A-Za-z0-9_])/TOR_REASONS_H/g; s/(?<![A-Za-z0-9_])_TOR_RELAY_H(?![A-Za-z0-9_])/TOR_RELAY_H/g; s/(?<![A-Za-z0-9_])_TOR_RENDCLIENT_H(?![A-Za-z0-9_])/TOR_RENDCLIENT_H/g; s/(?<![A-Za-z0-9_])_TOR_RENDCOMMON_H(?![A-Za-z0-9_])/TOR_RENDCOMMON_H/g; s/(?<![A-Za-z0-9_])_TOR_RENDMID_H(?![A-Za-z0-9_])/TOR_RENDMID_H/g; s/(?<![A-Za-z0-9_])_TOR_RENDSERVICE_H(?![A-Za-z0-9_])/TOR_RENDSERVICE_H/g; s/(?<![A-Za-z0-9_])_TOR_REPHIST_H(?![A-Za-z0-9_])/TOR_REPHIST_H/g; s/(?<![A-Za-z0-9_])_TOR_REPLAYCACHE_H(?![A-Za-z0-9_])/TOR_REPLAYCACHE_H/g; s/(?<![A-Za-z0-9_])_TOR_ROUTER_H(?![A-Za-z0-9_])/TOR_ROUTER_H/g; s/(?<![A-Za-z0-9_])_TOR_ROUTERLIST_H(?![A-Za-z0-9_])/TOR_ROUTERLIST_H/g; s/(?<![A-Za-z0-9_])_TOR_ROUTERPARSE_H(?![A-Za-z0-9_])/TOR_ROUTERPARSE_H/g; s/(?<![A-Za-z0-9_])TOR_ROUTERSET_H(?![A-Za-z0-9_])/TOR_ROUTERSET_H/g; s/(?<![A-Za-z0-9_])TOR_STATEFILE_H(?![A-Za-z0-9_])/TOR_STATEFILE_H/g; s/(?<![A-Za-z0-9_])_TOR_STATUS_H(?![A-Za-z0-9_])/TOR_STATUS_H/g; s/(?<![A-Za-z0-9_])TOR_TRANSPORTS_H(?![A-Za-z0-9_])/TOR_TRANSPORTS_H/g; s/(?<![A-Za-z0-9_])_TOR_TEST_H(?![A-Za-z0-9_])/TOR_TEST_H/g; s/(?<![A-Za-z0-9_])_TOR_FW_HELPER_H(?![A-Za-z0-9_])/TOR_TOR_FW_HELPER_H/g; s/(?<![A-Za-z0-9_])_TOR_FW_HELPER_NATPMP_H(?![A-Za-z0-9_])/TOR_TOR_FW_HELPER_NATPMP_H/g; s/(?<![A-Za-z0-9_])_TOR_FW_HELPER_UPNP_H(?![A-Za-z0-9_])/TOR_TOR_FW_HELPER_UPNP_H/g; ==============================
* Merge remote-tracking branch 'public/bug3894'Nick Mathewson2012-06-05
|\
| * Fix some more FreeBSD4 issues (based on a patch from grarpamp)Nick Mathewson2012-05-16
| | | | | | | | | | | | | | Apparently, freebsd 4 doesn't like malloc.h, needs sys/param.h for MIN/MAX, and doesn't have a SIZE_MAX. For bug 3894.
* | Update copyright dates to 2012; add a few missing copyright statementsNick Mathewson2012-06-04
| |
* | Actually pick a random port when "auto" is specifiedSebastian Hahn2011-08-17
|/ | | | ddc65e2b3303559ab7b842a176ee6c2eda9e4027 had broken this
* Merge remote-tracking branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson2011-04-27
|\ | | | | | | | | Conflicts: src/common/torint.h
| * Make SIZE_T_CEILING unsigned; add a signed SSIZE_T_CEILINGNick Mathewson2011-04-26
| | | | | | | | | | | | | | None of the comparisons were _broken_ previously, but avoiding signed/unsigned comparisons makes everybody happier. Fixes bug2475.
* | Doxygen documentation for about 100 things that didn't have anyNick Mathewson2011-03-16
| | | | | | | | About 860 doxygen-less things remain in 0.2.2
* | Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson2011-01-12
|\|
| * Make our replacement INT32_MAX always signedNick Mathewson2011-01-12
| | | | | | | | | | | | | | The C standard says that INT32_MAX is supposed to be a signed integer. On platforms that have it, we get the correct platform-defined value. Our own replacement, however, was unsigned. That's going to cause a bug somewhere eventually.
* | Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson2011-01-03
|\| | | | | | | | | | | Conflicts: src/common/test.h src/or/test.c
| * Bump copyright statements to 2011Nick Mathewson2011-01-03
| |
* | Merge remote branch fix_security_bug_021 into fix_security_bug_022Nick Mathewson2010-12-15
|\| | | | | | | | | | | | | Conflicts: src/common/memarea.c src/or/or.h src/or/rendclient.c
| * Base SIZE_T_CEILING on SSIZE_T_MAX.Nick Mathewson2010-12-13
| |
* | Merge remote branch 'origin/maint-0.2.1'Nick Mathewson2010-02-27
|\| | | | | | | | | | | Conflicts: src/common/test.h src/or/test.c
| * Update Tor Project copyright yearsNick Mathewson2010-02-27
| |
| * Code to parse and access network parameters.Nick Mathewson2009-10-14
| | | | | | | | | | Partial backport of 381766ce4b1145460. Partial backport of 56c6d78520a98fb64.
| * Update copyright to 2009.Karsten Loesing2009-05-04
| |
* | Implement proposal 167: Authorities vote on network parameters.Nick Mathewson2009-09-14
| | | | | | | | | | | | | | | | This code adds a new field to vote on: "params". It consists of a list of sorted key=int pairs. The output is computed as the median of all the integers for any key on which anybody voted. Improved with input from Roger.
* | Update copyright to 2009.Karsten Loesing2009-05-02
|/
* Support 64-bit time_t. Patch from Matthias Drochner. Partial backport ↵Nick Mathewson2009-01-22
| | | | | | candidate. svn:r18234
* Remove svn $Id$s from our source, and remove tor --version --version.Nick Mathewson2009-01-04
| | | | | | | | The subversion $Id$ fields made every commit force a rebuild of whatever file got committed. They were not actually useful for telling the version of Tor files in the wild. svn:r17867
* Use a consistent naming standard for header file guard macros, taking care ↵Nick Mathewson2008-12-29
| | | | | | not to collide with any system headers. This tripped us up on Android. svn:r17805
* make read_all and write_all return ssize_t.Nick Mathewson2008-11-05
| | | | svn:r17194
* r18360@catbus: nickm | 2008-02-21 22:26:32 -0500Nick Mathewson2008-02-22
| | | | | | | Make torint.h define ssize_t more robustly; add spaces to last patch svn:r13670
* r18345@catbus: nickm | 2008-02-21 13:45:04 -0500Nick Mathewson2008-02-21
| | | | | | | Do the last part of arma's fix for bug 437: Track the origin of every addrmap, and use this info so we can remove all the trackhostexits-originated mappings for a given exit. svn:r13660
* Update some copyright notices: it is now 2008.Nick Mathewson2008-02-07
| | | | svn:r13412
* clean up copyrights, and assign 2007 copyrights to The Tor Project, IncRoger Dingledine2007-12-12
| | | | svn:r12786
* r13362@catbus: nickm | 2007-06-11 19:00:23 -0400Nick Mathewson2007-06-11
| | | | | | | Fix a warning on platforms where sizeof(size_t)==8, but sizeof(unsigned long)<8. svn:r10566
* r11981@catbus: nickm | 2007-02-28 11:55:27 -0500Nick Mathewson2007-02-28
| | | | | | | Clamp declarable bandwidth at INT32_MAX, not INT_MAX. svn:r9677
* r11775@catbus: nickm | 2007-02-12 16:39:09 -0500Nick Mathewson2007-02-12
| | | | | | | Update copyright dates. svn:r9570
* r9313@totoro: nickm | 2006-11-13 20:07:41 -0500Nick Mathewson2006-11-14
| | | | | | | | | | | | | | | | | | | | | | | Try to compile with fewer warnings on irix64's MIPSpro compiler / environment, which apparently believes that: - off_t can be bigger than size_t. - only mean kids assign things they do not subsequently inspect. I don't try to fix the "error" that makes it say: cc-3970 cc: WARNING File = main.c, Line = 1277 conversion from pointer to same-sized integral type (potential portability problem) uintptr_t sig = (uintptr_t)arg; Because really, what can you do about a compiler that claims to be c99 but doesn't understand that void* x = NULL; uintptr_t y = (uintptr_t) x; is safe? svn:r8948
* r8971@totoro: nickm | 2006-10-09 10:16:23 -0400Nick Mathewson2006-10-09
| | | | | | | Move definition of ssize_t to torint.h svn:r8670
* r8844@totoro: nickm | 2006-10-02 16:32:44 -0400Nick Mathewson2006-10-02
| | | | | | | Resolve an XXXX: make sure that we are actually on 2s-complement hardware. svn:r8576
* Hm. We probably should define INT64_MAX if we really want it. (Especially ↵Nick Mathewson2006-07-18
| | | | | | since we only want it on one platform, where, coincidentally, it is not defined.) svn:r6784
* Avoid warnings about machine/limits.h on Debian GNU/kFreeBSDPeter Palfrader2006-03-29
| | | | svn:r6271
* Happy new year!Roger Dingledine2006-02-09
| | | | svn:r5949
* Fix logic to set TIME_T_MAX; apparently, everybody had thought of the ↵Nick Mathewson2005-07-25
| | | | | | prospect of a signed time_t but me. svn:r4675
* Change end-of-file NLNL convention. It turns out arma I and I agree.Nick Mathewson2005-06-09
| | | | svn:r4382
* New whitespace normalization rule: no blank line at EOF.Nick Mathewson2005-06-09
| | | | svn:r4378
* update copyright notices.Nick Mathewson2005-04-01
| | | | svn:r3982
* Finish implementing GETINFO; make it easy to query address maps.Nick Mathewson2005-03-03
| | | | svn:r3732
* Initial IRIX compatibility fixes: check for inttypes.h; check for platform ↵Nick Mathewson2005-02-22
| | | | | | cell_t. svn:r3648
* int is not necessarily the same size as size_tRoger Dingledine2004-12-05
| | | | svn:r3079
* Be more proactive about noticing underflows: size_t values greater than ↵Nick Mathewson2004-12-02
| | | | | | 0x800...00 are likely to be trouble. svn:r3064
* Suggestion from weasel: Make tor --version --version dump the cvs Id of ↵Nick Mathewson2004-11-29
| | | | | | every file. svn:r3019
* remove emacs droppings, since nick says he doesn't need them anymoreRoger Dingledine2004-11-26
| | | | svn:r2989