Where the printing is debug/diagnostic, we should probably just use %p.  The 
usage of x%u, 0x%lu, and similar predate ANSI providing %p.



On Oct 15, 2013, at 7:07 PM, tbrowd...@users.sourceforge.net wrote:

> Revision: 58180
>          http://sourceforge.net/p/brlcad/code/58180
> Author:   tbrowder2
> Date:     2013-10-15 23:06:58 +0000 (Tue, 15 Oct 2013)
> Log Message:
> -----------
> cast to %lx format (could use %p format in all of these)
> 
> Modified Paths:
> --------------
>    brlcad/trunk/src/librt/db5_alloc.c
> 
> Modified: brlcad/trunk/src/librt/db5_alloc.c
> ===================================================================
> --- brlcad/trunk/src/librt/db5_alloc.c        2013-10-15 23:01:26 UTC (rev 
> 58179)
> +++ brlcad/trunk/src/librt/db5_alloc.c        2013-10-15 23:06:58 UTC (rev 
> 58180)
> @@ -171,7 +171,8 @@
>     /* Start by zapping existing database object into a free object */
>     if (dp->d_addr != RT_DIR_PHONY_ADDR) {
>       if (RT_G_DEBUG&DEBUG_DB)
> -         bu_log("db5_realloc(%s) releasing storage at x%x, len=%zu\n", 
> dp->d_namep, dp->d_addr, dp->d_len);
> +         bu_log("db5_realloc(%s) releasing storage at x%lx, len=%zu\n",
> +                dp->d_namep, (unsigned long int)dp->d_addr, dp->d_len);
> 
>       rt_memfree(&(dbip->dbi_freep), dp->d_len, dp->d_addr);
>       if (db5_write_free(dbip, dp, dp->d_len) < 0) return -1;
> @@ -188,7 +189,8 @@
> 
>       if ((mmp = rt_memalloc_nosplit(&(dbip->dbi_freep), ep->ext_nbytes)) != 
> MAP_NULL) {
>           if (RT_G_DEBUG&DEBUG_DB)
> -             bu_log("db5_realloc(%s) obtained free block at x%x, len=%zu\n", 
> dp->d_namep, mmp->m_addr, mmp->m_size);
> +             bu_log("db5_realloc(%s) obtained free block at x%lx, len=%zu\n",
> +                    dp->d_namep, (unsigned long int)mmp->m_addr, 
> mmp->m_size);
>           BU_ASSERT_LONG((size_t)mmp->m_size, >=, (size_t)ep->ext_nbytes);
>           if ((size_t)mmp->m_size == (size_t)ep->ext_nbytes) {
>               /* No need to reformat, existing free object is perfect */
> @@ -202,7 +204,8 @@
>               dp->d_addr = mmp->m_addr + (off_t)ep->ext_nbytes;
>               dp->d_len = mmp->m_size - ep->ext_nbytes;
>               if (RT_G_DEBUG&DEBUG_DB)
> -                 bu_log("db5_realloc(%s) returning surplus at x%x, 
> len=%zu\n", dp->d_namep, dp->d_addr, dp->d_len);
> +                 bu_log("db5_realloc(%s) returning surplus at x%lx, 
> len=%zu\n",
> +                        dp->d_namep, (unsigned long int)dp->d_addr, 
> dp->d_len);
>               if (db5_write_free(dbip, dp, dp->d_len) < 0) return -1;
>               rt_memfree(&(dbip->dbi_freep), dp->d_len, dp->d_addr);
>               /* mmp is invalid beyond here! */
> @@ -211,7 +214,8 @@
>           dp->d_len = ep->ext_nbytes;
>           /* Erase the new place */
>           if (RT_G_DEBUG&DEBUG_DB)
> -             bu_log("db5_realloc(%s) utilizing free block at addr=x%x, 
> len=%zu\n", dp->d_namep, dp->d_addr, dp->d_len);
> +             bu_log("db5_realloc(%s) utilizing free block at addr=x%x, 
> len=%zu\n",
> +                    dp->d_namep, (unsigned long int)dp->d_addr, dp->d_len);
>           if (db5_write_free(dbip, dp, dp->d_len) < 0) return -1;
>           return 0;
>       }
> @@ -222,7 +226,8 @@
>     dbip->dbi_eof += (off_t)ep->ext_nbytes;
>     dp->d_len = ep->ext_nbytes;
>     if (RT_G_DEBUG&DEBUG_DB)
> -     bu_log("db5_realloc(%s) extending database addr=x%x, len=%zu\n", 
> dp->d_namep, dp->d_addr, dp->d_len);
> +     bu_log("db5_realloc(%s) extending database addr=x%x, len=%zu\n",
> +            dp->d_namep, (unsigned long int)dp->d_addr, dp->d_len);
>     return 0;
> }
> 
> 
> This was sent by the SourceForge.net collaborative development platform, the 
> world's largest Open Source development site.
> 
> 
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
> _______________________________________________
> BRL-CAD Source Commits mailing list
> brlcad-comm...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/brlcad-commits


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel

Reply via email to