[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1350021 - in /subversion/trunk/subversion: libsvn_subr/adler32.c libsvn_subr/cache-membuffer.c libsvn_subr/cache.c libsvn_subr/string.c mod_authz_svn/mod_authz_svn.c svnserve/main.c

From: Greg Stein <gstein_at_gmail.com>
Date: Thu, 14 Jun 2012 08:16:02 +0200

Adjust the log message to note the incorrect main change, and the revision
where it was reverted?
On Jun 13, 2012 11:22 PM, <stefan2_at_apache.org> wrote:

> Author: stefan2
> Date: Wed Jun 13 21:22:24 2012
> New Revision: 1350021
>
> URL: http://svn.apache.org/viewvc?rev=1350021&view=rev
> Log:
> Silence more GCC conversion warnings (-Wconversion).
>
> * subversion/libsvn_subr/adler32.c
> (svn__adler32): adler32 returns always 32 bits
> * subversion/libsvn_subr/cache.c
> (svn_cache__format_info): do all calculations in double
> * subversion/libsvn_subr/cache-membuffer.c
> (is_group_initialized, initialize_group): explicitly cast to bytes
> (svn_cache__membuffer_cache_create): test for overflow before casting
> * subversion/libsvn_subr/string.c
> (svn__ui64toa): result of % will fit into 32 bits
> * subversion/mod_authz_svn/mod_authz_svn.c
> (convert_case): explicitly cast back to char
>
> Modified:
> subversion/trunk/subversion/libsvn_subr/adler32.c
> subversion/trunk/subversion/libsvn_subr/cache-membuffer.c
> subversion/trunk/subversion/libsvn_subr/cache.c
> subversion/trunk/subversion/libsvn_subr/string.c
> subversion/trunk/subversion/mod_authz_svn/mod_authz_svn.c
> subversion/trunk/subversion/svnserve/main.c
>
> Modified: subversion/trunk/subversion/libsvn_subr/adler32.c
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/adler32.c?rev=1350021&r1=1350020&r2=1350021&view=diff
>
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_subr/adler32.c (original)
> +++ subversion/trunk/subversion/libsvn_subr/adler32.c Wed Jun 13 21:22:24
> 2012
> @@ -61,7 +61,9 @@ svn__adler32(apr_uint32_t checksum, cons
> * optimized code. Also, new zlib versions will come with
> * SIMD code for x86 and x64.
> */
> - return adler32(checksum, (const Bytef *)data, (uInt)len);
> + return (apr_uint32_t)adler32(checksum,
> + (const Bytef *)data,
> + (uInt)len);
> }
> else
> {
>
> Modified: subversion/trunk/subversion/libsvn_subr/cache-membuffer.c
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/cache-membuffer.c?rev=1350021&r1=1350020&r2=1350021&view=diff
>
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_subr/cache-membuffer.c (original)
> +++ subversion/trunk/subversion/libsvn_subr/cache-membuffer.c Wed Jun 13
> 21:22:24 2012
> @@ -700,9 +700,11 @@ let_entry_age(svn_membuffer_t *cache, en
> static APR_INLINE unsigned char
> is_group_initialized(svn_membuffer_t *cache, apr_uint32_t group_index)
> {
> - unsigned char flags = cache->group_initialized
> - [group_index / (8 * GROUP_INIT_GRANULARITY)];
> - unsigned char bit_mask = 1 << ((group_index / GROUP_INIT_GRANULARITY) %
> 8);
> + unsigned char flags
> + = cache->group_initialized[group_index / (8 *
> GROUP_INIT_GRANULARITY)];
> + unsigned char bit_mask
> + = (unsigned char)(1 << ((group_index / GROUP_INIT_GRANULARITY) % 8));
> +
> return flags & bit_mask;
> }
>
> @@ -726,7 +728,8 @@ initialize_group(svn_membuffer_t *cache,
> cache->directory[i][j].offset = NO_OFFSET;
>
> /* set the "initialized" bit for these groups */
> - bit_mask = 1 << ((group_index / GROUP_INIT_GRANULARITY) % 8);
> + bit_mask
> + = (unsigned char)(1 << ((group_index / GROUP_INIT_GRANULARITY) % 8));
> cache->group_initialized[group_index / (8 * GROUP_INIT_GRANULARITY)]
> |= bit_mask;
> }
> @@ -1075,11 +1078,10 @@ svn_cache__membuffer_cache_create(svn_me
> * Note, that this limit could only be exceeded in a very
> * theoretical setup with about 1EB of cache.
> */
> - group_count = directory_size / sizeof(entry_group_t);
> - if (group_count >= (APR_UINT32_MAX / GROUP_SIZE))
> - {
> - group_count = (APR_UINT32_MAX / GROUP_SIZE) - 1;
> - }
> + group_count = directory_size / sizeof(entry_group_t)
> + >= (APR_UINT32_MAX / GROUP_SIZE)
> + ? (APR_UINT32_MAX / GROUP_SIZE) - 1
> + : (apr_uint32_t)(directory_size / sizeof(entry_group_t));
>
> group_init_size = 1 + group_count / (8 * GROUP_INIT_GRANULARITY);
> for (seg = 0; seg < segment_count; ++seg)
>
> Modified: subversion/trunk/subversion/libsvn_subr/cache.c
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/cache.c?rev=1350021&r1=1350020&r2=1350021&view=diff
>
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_subr/cache.c (original)
> +++ subversion/trunk/subversion/libsvn_subr/cache.c Wed Jun 13 21:22:24
> 2012
> @@ -212,14 +212,14 @@ svn_cache__format_info(const svn_cache__
> enum { _1MB = 1024 * 1024 };
>
> apr_uint64_t misses = info->gets - info->hits;
> - double hit_rate = (100.0 * info->hits)
> - / (info->gets ? info->gets : 1);
> - double write_rate = (100.0 * info->sets)
> - / (misses ? misses : 1);
> - double data_usage_rate = (100.0 * info->used_size)
> - / (info->data_size ? info->data_size : 1);
> - double data_entry_rate = (100.0 * info->used_entries)
> - / (info->total_entries ? info->total_entries :
> 1);
> + double hit_rate = (100.0 * (double)info->hits)
> + / (double)(info->gets ? info->gets : 1);
> + double write_rate = (100.0 * (double)info->sets)
> + / (double)(misses ? misses : 1);
> + double data_usage_rate = (100.0 * (double)info->used_size)
> + / (double)(info->data_size ? info->data_size :
> 1);
> + double data_entry_rate = (100.0 * (double)info->used_entries)
> + / (double)(info->total_entries ? info->total_entries :
> 1);
>
> return svn_string_createf(result_pool,
>
>
> Modified: subversion/trunk/subversion/libsvn_subr/string.c
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/string.c?rev=1350021&r1=1350020&r2=1350021&view=diff
>
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_subr/string.c (original)
> +++ subversion/trunk/subversion/libsvn_subr/string.c Wed Jun 13 21:22:24
> 2012
> @@ -976,7 +976,7 @@ svn__ui64toa(char * dest, apr_uint64_t n
> /* Number is larger than 100^4, i.e. we can write 4x2 chars.
> * Also, use 32 bit DIVs as these are about twice as fast.
> */
> - reduced = number % 100000000;
> + reduced = (apr_uint32_t)(number % 100000000);
> number /= 100000000;
>
> COPY_TWO_BYTES(target - 0, decimal_table[reduced % 100]);
>
> Modified: subversion/trunk/subversion/mod_authz_svn/mod_authz_svn.c
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_authz_svn/mod_authz_svn.c?rev=1350021&r1=1350020&r2=1350021&view=diff
>
> ==============================================================================
> --- subversion/trunk/subversion/mod_authz_svn/mod_authz_svn.c (original)
> +++ subversion/trunk/subversion/mod_authz_svn/mod_authz_svn.c Wed Jun 13
> 21:22:24 2012
> @@ -235,7 +235,7 @@ convert_case(char *text, svn_boolean_t t
> char *c = text;
> while (*c)
> {
> - *c = (to_uppercase ? apr_toupper(*c) : apr_tolower(*c));
> + *c = (char)(to_uppercase ? apr_toupper(*c) : apr_tolower(*c));
> ++c;
> }
> }
>
> Modified: subversion/trunk/subversion/svnserve/main.c
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/svnserve/main.c?rev=1350021&r1=1350020&r2=1350021&view=diff
>
> ==============================================================================
> --- subversion/trunk/subversion/svnserve/main.c (original)
> +++ subversion/trunk/subversion/svnserve/main.c Wed Jun 13 21:22:24 2012
> @@ -898,6 +898,60 @@ int main(int argc, const char *argv[])
> apr_signal(SIGXFSZ, SIG_IGN);
> #endif
>
> +#ifdef SIGUSR1
> + /* Disable SIGPIPE generation for the platforms that have it. */
> + apr_signal(SIGUSR1, SIG_IGN);
> +/*
> +#ifdef WIN32
> +LRESULT CALLBACK ipc_window_proc(HWND hWnd, UINT message, WPARAM wParam,
> LPARAM lParam)
> +{
> + switch (message)
> + {
> + case WM_USER: ipc_recv(0);
> + break;
> + default: return DefWindowProc(hWnd, message, wParam, lParam);
> + break;
> +
> + }
> + return 0;
> +}
> +#endif
> +void ipc_init()
> +{
> + string cdir = config_dir();
> + db_path = cdir + "/dropbox.xdf";
> + sig_path = cdir + "/sig";
> +#ifndef WIN32
> + signal(SIGUSR1, ipc_recv);
> +#else
> + //welcome to hell
> + HINSTANCE inst =
> (HINSTANCE)GetWindowLong((HWND)GDK_WINDOW_HWND(get_mainwin()->window),
> GWL_HINSTANCE);
> + WNDCLASSEX wcex;
> + wcex.cbSize = sizeof(WNDCLASSEX);
> + wcex.style = 0;
> + wcex.lpfnWndProc = ipc_window_proc;
> + wcex.cbClsExtra = 0;
> + wcex.cbWndExtra = 0;
> + wcex.hCursor = 0;
> + wcex.hbrBackground = 0;
> + wcex.hIcon = 0;
> + wcex.hIconSm = 0;
> + wcex.hInstance = inst;
> + wcex.lpszMenuName = NULL;
> + wcex.lpszClassName = "MyApp Messages";
> + if(!RegisterClassEx(&wcex))
> + cerr << "Cannot register IPC window class!" << endl;
> + ipc_window = CreateWindow(wcex.lpszClassName, "MyApp IPC",
> WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 500, 100, HWND_MESSAGE,
> NULL, inst, NULL);
> + if(!ipc_window)
> + cerr << "Cannot create IPC window (" << (int)GetLastError() << ")" <<
> endl;
> +#endif
> + ofstream out(sig_path.c_str());
> + out << getpid() << endl;
> + out.close();
> +}
> +*/
> +#endif
> +
> if (pid_filename)
> SVN_INT_ERR(write_pid_file(pid_filename, pool));
>
>
>
>
Received on 2012-06-14 08:59:02 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.