[ 
https://issues.apache.org/jira/browse/TS-228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13726316#comment-13726316
 ] 

Leif Hedstrom commented on TS-228:
----------------------------------

Some candidates:

{code}

build/tcl.m4:       tcl_type_64bit=__int64, tcl_type_64bit="long long")
build/tcl.m4:   AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Are wide integers to be 
implemented with C 'long's?])
cop/TrafficCop.cc:    long long memfree, swapfree, swapsize;
doc/admin/index.en.rst:interactions and optimize performance. Along with other 
information, the
doc/reference/configuration/records.config.en.rst:This solution must be 
considered interim. In the longer term, it
doc/sdk/io-guide/transformations.en.rst:       /* Tell the read buffer that we 
have read the data and are no longer interested in it. */
example/append-transform/append-transform.c:         longer interested in it. */
example/bnull-transform/bnull-transform.c:         longer interested in it. */
example/null-transform/null-transform.c:       * longer interested in it.
example/remap/remap.cc:static volatile unsigned long processing_counter = 0;   
// sequential counter
example/remap/remap.cc:  unsigned long _processing_counter = 
++processing_counter;     // one more function call (in real life use mutex to 
protect this counter)
example/server-transform/server-transform.c:         longer interested in it. */
example/thread-pool/psi.c:        /* Consume data we've processed an we are no 
longer interested in */
iocore/cache/Cache.cc:    vol_dirlen(this), (long long)this->len, 
(double)vol_dirlen(this) / (double)this->len * 100.0);
iocore/cluster/ClusterCache.cc:unmarshal_CacheOpMsg_long(void *data, int 
NeedByteSwap)
iocore/cluster/ClusterCache.cc:      int flen = 
CacheOpMsg_long::sizeof_fixedlen_msg();
iocore/cluster/ClusterCache.cc:      int flen = 
CacheOpMsg_long::sizeof_fixedlen_msg();
iocore/cluster/ClusterProcessor.cc:unsigned long cluster_sockopt_flags = 0;
iocore/cluster/ClusterProcessor.cc:unsigned long cluster_packet_mark = 0;
iocore/cluster/ClusterProcessor.cc:unsigned long cluster_packet_tos = 0;
iocore/cluster/P_ClusterCacheInternal.h:  CacheOpMsg_long(uint16_t vers = 
CACHE_OP_LONG_MESSAGE_VERSION):
iocore/cluster/P_ClusterInline.h:  int vers = 
CacheOpMsg_long::protoToVersion(owner_machine->msg_proto_major);
iocore/cluster/P_ClusterInline.h:  int vers = 
CacheOpMsg_long::protoToVersion(m->msg_proto_major);
iocore/cluster/P_ClusterMachine.h:#define NO_RACE_DELAY                  
HRTIME_HOUR      // a long long time
iocore/eventsystem/I_SocketManager.h:  int poll(struct pollfd *fds, unsigned 
long nfds, int timeout);
iocore/eventsystem/Lock.cc:    fprintf(stderr, "WARNING: holding lock %s:%d too 
long for %s\n",
iocore/eventsystem/P_UnixSocketManager.h:SocketManager::poll(struct pollfd 
*fds, unsigned long nfds, int timeout)
iocore/hostdb/include/Machine.h:#define NO_RACE_DELAY                  
HRTIME_HOUR      // a long long time
iocore/net/I_NetVConnection.h:  void set_sock_param(int _recv_bufsize, int 
_send_bufsize, unsigned long _opt_flags,
iocore/net/I_NetVConnection.h:                      unsigned long _packet_mark 
= 0, unsigned long _packet_tos = 0);
iocore/net/P_UnixNetVConnection.h:NetVCOptions::set_sock_param(int 
_recv_bufsize, int _send_bufsize, unsigned long _opt_flags,
iocore/net/P_UnixNetVConnection.h:                             unsigned long 
_packet_mark, unsigned long _packet_tos)
iocore/net/SSLUtils.cc:static unsigned long
iocore/net/SSLUtils.cc:  return (unsigned long) (eth->id);
iocore/net/SSLUtils.cc:  unsigned long l;
iocore/net/SSLUtils.cc:  unsigned long es;
iocore/net/test_certlookup.cc:  box.check(lookup.findInfoInHash(endpoint.ip6) 
== context.ip6, "IPv6 longest match lookup");
iocore/net/test_certlookup.cc:  box.check(lookup.findInfoInHash(endpoint.ip6p) 
== context.ip6p, "IPv6 longest match lookup w/ port");
iocore/net/test_certlookup.cc:  box.check(lookup.findInfoInHash(endpoint.ip4) 
== context.ip4, "IPv4 longest match lookup");
iocore/net/test_certlookup.cc:  box.check(lookup.findInfoInHash(endpoint.ip4p) 
== context.ip4p, "IPv4 longest match lookup w/ port");
lib/ts/IpMap.h:      This holds an interval based on a metric @a T along with
lib/ts/IpMapConf.cc:    snprintf(err, ERR_STRING_LEN, "IP address too long");
lib/ts/ink_align.h:// messages concerning coercion between void* and unsigned 
long.
lib/ts/ink_atomic.h:typedef unsigned long uint64_s;
lib/ts/ink_atomic.h:static inline int     ink_atomic_increment(pvint32 mem, 
long value) { return ((uint32_t)atomic_add_32_nv((pvuint32)mem, 
(uint32_t)value)) - value; }
lib/ts/ink_cap.cc:        (unsigned long long)pthread_self() );
lib/ts/ink_hrtime.cc:squid_timestamp_to_buf(char *buf, unsigned int buf_size, 
long timestamp_sec, long timestamp_usec)
lib/ts/ink_hrtime.h:int squid_timestamp_to_buf(char *buf, unsigned int 
buf_size, long timestamp_sec, long timestamp_usec);
lib/ts/ink_memory.cc:  // this was long long ago
lib/ts/test_atomic.cc:  printf("Testing atomic lists (long version)\n");
mgmt/Alarms.h:  unsigned long inet_address;   /* If not local */
mgmt/api/INKMgmtAPI.cc:  for (unsigned long i = 0; i < queue_len((LLQ *) intl); 
i++) {
mgmt/api/include/mgmtapi.h:    /*unsigned long inet_address; *//* for remote 
peer events */
mgmt/api/include/mgmtapi.h:    /*unsigned long timestamp; *//* only applies to 
active events */
mgmt/api/remote/CoreAPIRemote.cc:// NOTE: use long long, not just long, MgmtInt 
= int64_t
mgmt/cli/ConfigCmd.cc:  case TS_REC_INT:            // TS64 aka "long long"
mgmt/cli/ConfigCmd.cc:  case TS_REC_COUNTER:        // TS64 aka "long long"
mgmt/cluster/ClusterCom.cc:ClusterCom::ClusterCom(unsigned long oip, char 
*host, int mcport, char *group, int rsport, char *p)
mgmt/cluster/ClusterCom.cc:ClusterCom::sendReliableMessage(unsigned long addr, 
char *buf, int len)
mgmt/cluster/ClusterCom.cc:ClusterCom::rl_sendReliableMessage(unsigned long 
addr, const char *buf, int len)
mgmt/cluster/ClusterCom.cc:ClusterCom::sendReliableMessage(unsigned long addr, 
char *buf, int len, char *reply, int len2, bool take_lock)
mgmt/cluster/ClusterCom.cc:ClusterCom::sendReliableMessageReadTillClose(unsigned
 long addr, char *buf, int len, textBuffer * reply)
mgmt/cluster/ClusterCom.cc:  unsigned long min = 0;
mgmt/cluster/ClusterCom.cc:unsigned long
mgmt/cluster/ClusterCom.cc:  unsigned long min_ip = 0;
mgmt/cluster/ClusterCom.cc:unsigned long
mgmt/cluster/ClusterCom.cc:  unsigned long max_ip = 0;
mgmt/cluster/ClusterCom.cc:             lmgmt->watched_process_fd, (long 
int)lmgmt->watched_process_pid);
mgmt/cluster/ClusterCom.h:  unsigned long inet_address;   /* IP addr of node */
mgmt/cluster/ClusterCom.h:  ClusterCom(unsigned long oip, char *hname, int 
mcport, char *group, int rsport, char *p);
mgmt/cluster/ClusterCom.h:  bool sendReliableMessage(unsigned long addr, char 
*buf, int len);
mgmt/cluster/ClusterCom.h:  bool rl_sendReliableMessage(unsigned long addr, 
const char *buf, int len);
mgmt/cluster/ClusterCom.h:  bool sendReliableMessage(unsigned long addr, char 
*buf, int len, char *reply, int len2, bool take_lock);
mgmt/cluster/ClusterCom.h:  bool sendReliableMessageReadTillClose(unsigned long 
addr, char *buf, int len, textBuffer * reply);
mgmt/cluster/ClusterCom.h:  unsigned long lowestPeer(int *no);
mgmt/cluster/ClusterCom.h:  unsigned long highestPeer(int *no);
mgmt/cluster/ClusterCom.h:  unsigned long getIP()
mgmt/cluster/ClusterCom.h:  unsigned long our_ip;
mgmt/cluster/VMap.cc:VMap::VMap(char *interface, unsigned long ip, ink_mutex * 
m)
mgmt/cluster/VMap.cc:    addr_list = (unsigned long 
*)ats_malloc(sizeof(unsigned long) * num_addrs);
mgmt/cluster/VMap.cc:unsigned long
mgmt/cluster/VMap.h:  VMap(char *interface, unsigned long ip, ink_mutex * m);
mgmt/cluster/VMap.h:  unsigned long rl_boundTo(char *virt_ip);
mgmt/cluster/VMap.h:  unsigned long *addr_list;
mgmt/cluster/VMap.h:  unsigned long our_ip;
mgmt/utils/MgmtUtils.cc:  unsigned long min;
mgmt/utils/WebMgmtUtils.cc:  const long int mb = 1048576;
mgmt/utils/WebMgmtUtils.cc:  const long int kb = 1024;
mgmt/utils/WebMgmtUtils.cc:  int inLength = strlen(buffer);        // how long 
the orig buffer in
mgmt/web2/WebOverview.cc:overviewRecord::overviewRecord(unsigned long 
inet_addr, bool local, ClusterPeerInfo * cpi)
mgmt/web2/WebOverview.cc:  unsigned long int ipAddr;
mgmt/web2/WebOverview.cc:  if ((long int) ipAddr == -1) {
mgmt/web2/WebOverview.h://    unsigned long).  A second mapping is also 
maintained in sortRecords.
mgmt/web2/WebOverview.h:  overviewRecord(unsigned long inet_addr, bool local, 
ClusterPeerInfo * cpi = NULL);
mgmt/web2/WebOverview.h:  unsigned long inetAddr;       // IP address of the 
node
mgmt/web2/WebOverview.h:  unsigned long ourAddr;        // the IP address of 
this node
plugins/experimental/buffer_upload/buffer_upload.cc:              unsigned long 
ulv = strtoul(tok, &end, 10);
plugins/experimental/buffer_upload/buffer_upload.cc:                *((unsigned 
long *) cv->val) = ulv;
plugins/experimental/esi/esi.cc:    int longindex = 0;
plugins/experimental/esi/fetcher/HttpDataFetcherImpl.cc:             
static_cast<long int>(FETCH_EVENT_ID_BASE + (_page_entry_lookup.size() * 3)));
plugins/experimental/esi/lib/Stats.cc://FIXME step should be TSMgmtInt but for 
some reason the linker is having some strange int vs long name mangling issue.
plugins/experimental/esi/serverIntercept.cc:            TSDebug(DEBUG_TAG, 
"[%s] Appending %ld bytes to body", __FUNCTION__, static_cast<long int>(endptr 
- data));
plugins/experimental/esi/serverIntercept.cc:             __FUNCTION__, 
static_cast<long int>(cont_data->req_content_len - cont_data->body.size()));
plugins/experimental/lua/remap.cc:  LuaLogDebug("handling request %p on thread 
0x%llx", rri, (unsigned long long)pthread_self());
plugins/experimental/lua/state.cc:template <> struct is_integral_type<long> { 
enum { value = 1, is_pointer = 0 }; };
plugins/experimental/lua/state.cc:template <> struct is_integral_type<unsigned 
long> { enum { value = 1, is_pointer = 0 }; };
plugins/experimental/spdy/lib/spdy/message.cc:        // spec is no longer on 
the internets.
plugins/experimental/spdy/lib/spdy/zstream.cc:unsigned long dictionary_id()
plugins/experimental/spdy/lib/spdy/zstream.cc:    unsigned long id;
proxy/InkAPITest.cc:  unsigned long magic;
proxy/InkAPITest.cc:         longer interested in it. */
proxy/InkAPITest.cc:  unsigned long magic;
proxy/Main.cc:      fprintf(stderr, " (Lock file held by process ID %ld)\n", 
(long)holding_pid);
proxy/Main.cc:    printf("The interactive command mode no longer exists.\n");
proxy/Plugin.cc:      snprintf(str, 128, "%ld", (long int) int_val);
proxy/Plugin.cc:      snprintf(str, 128, "%ld", (long int) count_val);
proxy/ReverseProxy.cc:  int my_token = (int) (long) cookie;
proxy/TestProxy.cc:        printf("TestProxy startEvent line too long\n");
proxy/UDPAPIClientTest.cc:  unsigned long ip;
proxy/UDPAPITest.cc:  unsigned long ip;
proxy/api/ts/remap.h:    unsigned long size;         /* in: sizeof(struct 
_tsremap_api_info) */
proxy/api/ts/remap.h:    unsigned long tsremap_version;      /* in: TS 
supported version ((major << 16) | minor) */
proxy/congest/Congestion.cc:FailHistory::init_event(long t, int n)
proxy/congest/Congestion.cc:FailHistory::regist_event(long t, int n)
proxy/congest/Congestion.h:  void init_event(long t, int n = 1);
proxy/congest/Congestion.h:  int regist_event(long t, int n = 1);
proxy/congest/FeatureSpec.txt:  unsigned long   num_congested;    // reserved 
for per server stat.
proxy/hdrs/HdrTest.cc:             (unsigned long) fast_t, dates[i].fast, 
(unsigned long) slow_t, dates[i].slow);
proxy/hdrs/HttpCompat.cc:  int longest_match_len = 0;
proxy/http/HttpAccept.h:      from the config file and a static is initialized 
long before that point.
proxy/http/HttpTransactHeaders.cc:  // + 23 for 20 possible digits of warning 
code (long long max
proxy/http/remap/UrlRewrite.cc:unsigned long
proxy/http/remap/UrlRewrite.cc:check_remap_option(char *argv[], int argc, 
unsigned long findmode = 0, int *_ret_idx = NULL, char **argptr = NULL)
proxy/http/remap/UrlRewrite.cc:  unsigned long ret_flags = 0;
proxy/http/remap/UrlRewrite.cc:  unsigned long ul;
proxy/http/remap/UrlRewrite.h:  unsigned long remap_optflg;
proxy/logging/Log.cc:volatile unsigned long Log::flush_counter = 0;
proxy/logging/Log.h:  static volatile unsigned long flush_counter;
proxy/logging/LogBuffer.cc:                                int write_to_len, 
long timestamp, long timestamp_usec,
proxy/logging/LogBuffer.h:                                  int write_to_len, 
long timestamp, long timestamp_us,
proxy/logging/LogFieldAliasMap.h:    unsigned long a;
proxy/logging/LogFieldAliasMap.h:    if (sscanf(str, "%lx", (unsigned long *) 
&a) == 1) {
proxy/logging/LogFile.cc:LogFile::roll(long interval_start, long interval_end)
proxy/logging/LogFile.cc:      n = snprintf(_buffer, BUF_SIZE, "creation_time = 
%lu\n", (unsigned long) _creation_time);
proxy/logging/LogFile.h:  int roll(long interval_start, long interval_end);
proxy/logging/LogFormat.h:  long interval() const { return m_interval_sec; }
proxy/logging/LogFormat.h:  long m_interval_sec;
proxy/logging/LogFormat.h:  long m_interval_next;
proxy/logging/LogObject.h:  int roll_files(long time_now = 0);
proxy/logging/LogObject.h:  int _roll_files(long interval_start, long 
interval_end);
proxy/logging/LogObject.h:  int _roll_files(long time_now, bool 
roll_only_if_needed);
proxy/logging/LogObject.h:  int roll_files(long time_now);
proxy/logging/LogObject.h:inline int LogObjectManager::roll_files(long time_now)
proxy/logging/LogUtils.cc:LogUtils::timestamp_to_str(long timestamp, char *buf, 
int size)
proxy/logging/LogUtils.h:  static int timestamp_to_str(long timestamp, char 
*buf, int size);
tools/apichecker.pl:my $W_NOT_NULL_LEN = "the length parameter can no longer be 
a NULL pointer";
tools/http_load/http_load.c:static long long total_bytes;
tools/http_load/http_load.c:static long long total_connect_usecs, 
max_connect_usecs, min_connect_usecs;
tools/http_load/http_load.c:static long long total_response_usecs, 
max_response_usecs, min_response_usecs;
tools/http_load/http_load.c:static long start_interval, low_interval, 
high_interval, range_interval;
tools/http_load/http_load.c:static long long delta_timeval(struct timeval 
*start, struct timeval *finish);
tools/http_load/http_load.c:                     hostname, (unsigned long) 
sizeof(urls[url_num].sa), (unsigned long) aiv4->ai_addrlen);
tools/http_load/http_load.c:                     hostname, (unsigned long) 
sizeof(urls[url_num].sa), (unsigned long) aiv6->ai_addrlen);
tools/http_load/http_load.c:          url_num = ((unsigned long) random()) % 
((unsigned int) num_urls);
tools/http_load/http_load.c:          url_num = ((unsigned long) random()) % 
((unsigned int) num_urls);
tools/http_load/http_load.c:      sip_num = ((unsigned long) random()) % 
((unsigned int) num_sips);
tools/http_load/http_load.c:                   (long long) tv.tv_usec, 
urls[connections[cnum].url_num].url_str, idle_secs,
tools/http_load/http_load.c:                   (long long) tv.tv_usec, 
urls[connections[cnum].url_num].url_str, idle_secs,
tools/http_load/http_load.c:    long long connect_usecs = 
delta_timeval(&connections[cnum].connect_at, &connections[cnum].request_at);
tools/http_load/http_load.c:    long long response_usecs = 
delta_timeval(&connections[cnum].request_at, &connections[cnum].response_at);
tools/http_load/http_load.c:    (void) tmr_create(nowP, start_timer, 
JunkClientData, (long) (random() % range_interval) + low_interval, 0);
tools/http_load/http_load.c:static long long
tools/http_load/http_load.c:  long long delta_secs = finish->tv_sec - 
start->tv_sec;
tools/http_load/http_load.c:  long long delta_usecs = finish->tv_usec - 
start->tv_usec;
tools/http_load/http_load.c:  return delta_secs * (long long) 1000000L + 
delta_usecs;
tools/http_load/timers.c:tmr_create(struct timeval *nowP, TimerProc * 
timer_proc, ClientData client_data, long msecs, int periodic)
tools/http_load/timers.h:                         long msecs, int periodic);
tools/jtest/jtest.cc:static void make_long_response(int sock) {
tools/jtest/jtest.cc:          printf("header too long '%s'", 
fd[sock].req_header);
tools/jtest/jtest.cc:    unsigned long long int doc = get_zipf(dr);
tools/jtest/jtest.cc:    unsigned long long int doc_len_int = doc * 
0x14A4D0FB0E93E3A7LL;
tools/jtest/jtest.cc:    unsigned long int x = doc_len_int;
{code}

                
> Cleanup usage of "long" in all code
> -----------------------------------
>
>                 Key: TS-228
>                 URL: https://issues.apache.org/jira/browse/TS-228
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Cleanup
>    Affects Versions: 2.1.0
>            Reporter: John Plevyak
>            Assignee: James Peach
>            Priority: Critical
>             Fix For: 3.5.1
>
>
> Solaris 64-bit SunPro long is 64-bit while for g++ 64-bit long is 32-bit.
> This is a potential can of worms which at the least is making records.snap
> incompatible but at worse could be the cause of other bugs.
> In any case we should not be using "long" in the TS code, but instead use
> either "int" which is always 32-bits or "inkXXX" of a particular size.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to