This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
Re: [Patch] Add rebase-dump application to rebase package
On Aug 3 09:44, Charles Wilson wrote:
> On 8/3/2011 4:30 AM, Corinna Vinschen wrote:
> > Hmm. I just figured that moving the entire db stuff into rebase-db.c
> > isn't as simple as I imagined. Functions and global variables are
> > pretty much intertwined in a non modular way.
>
> Yep...I had similar, but much smaller, issues when moving the dump_*
> methods to rebase-db.[h,c]. This will be a non-trivial refactoring.
>
> > I assume you might just go ahead and apply your dumper and we get
> > a new rebase package out of the door. We can clean this up later.
>
> Ack. Given Jason hasn't reponded to my patch, and your positive review,
> I've invoked the libtool 3-day rule and committed it.
>
> > Idle musing: I think we should create some sort of global settings
> > structure which can be used as a parameter or something...
>
> Yep. That's typically the way I handle these issues, even in very simple
> apps that don't need it -- 'cause they ALWAYS grow to become non-simple,
> and it's a lot harder to add it later. :-)
>
> But that can also wait until after the next release. AFAICT, we're
> ready to go -- so it's up to Jason to bump the library and application
> version numbers, tag it in cvs, and publish a new package.
Your rebase-dump doesn't build cleanly on mingw64:
cc1: warnings being treated as errors
rebase-dump.c: In function âload_image_infoâ:
rebase-dump.c:128:6: error: format â%uâ expects type âunsigned intâ, but argument 2 has type âlong long unsigned intâ
rebase-dump.c:128:6: error: format â%08xâ expects type âunsigned intâ, but argument 3 has type âlong long unsigned intâ
rebase-dump.c:183:15: error: format â%uâ expects type âunsigned intâ, but argument 2 has type âlong long unsigned intâ
rebase-dump.c:183:15: error: format â%08xâ expects type âunsigned intâ, but argument 3 has type âlong long unsigned intâ
make: *** [rebase-dump.o] Error 1
Here's my fix:
Index: rebase-dump.c
===================================================================
RCS file: /sourceware/projects/cygwin-apps-home/cvsfiles/rebase/rebase-dump.c,v
retrieving revision 1.1
diff -u -p -r1.1 rebase-dump.c
--- rebase-dump.c 3 Aug 2011 13:40:16 -0000 1.1
+++ rebase-dump.c 5 Aug 2011 11:31:28 -0000
@@ -124,7 +124,7 @@ load_image_info ()
return -1;
}
if (verbose)
- printf ("== read %u (0x%08x) bytes (database header)\n",
+ printf ("== read %zu (0x%08zx) bytes (database header)\n",
sizeof hdr, sizeof hdr);
/* Check the header. */
@@ -178,7 +178,7 @@ load_image_info ()
}
if (ret == 0 && verbose)
{
- printf ("== read %u (0x%08x) bytes (database w/o strings)\n",
+ printf ("== read %zu (0x%08zx) bytes (database w/o strings)\n",
img_info_size * sizeof (img_info_t),
img_info_size * sizeof (img_info_t));
}
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat