[Xcb] Git usage question

Ulrich Eckhardt doomster at knuut.de
Fri Oct 3 03:43:11 PDT 2008


Hi!

I'm looking at http://xcb.freedesktop.org/DevelopersGuide/, and there's 
something missing: an example. What I have in mind is something that shows a 
prospective patch-submitter how to get the sources, make a change and submit 
a patch to the mailinglist.

I just did approximately this:

  git clone git://anongit.freedesktop.org/git/xcb/util
  cd util
  git branch --track -l example-branch
  $(EDITOR) <files>
  git commit -a
  git log -p -1 > ../example.patch

which would serve as example. The resulting patch is below, btw. Does that 
look good? Should I have attached it rather? Any other suggestions?

cheers

Uli


commit 7e11f6af2d597ac208813fe0f4b65868f2ee0945
Author: Ulrich Eckhardt <doomster at knuut.de>
Date:   Fri Oct 3 11:34:43 2008 +0200

    Do not cast the returnvalue of malloc() in C.

diff --git a/image/xcb_image.c b/image/xcb_image.c
index 2388948..701dda4 100644
--- a/image/xcb_image.c
+++ b/image/xcb_image.c
@@ -227,7 +227,7 @@ xcb_image_create (uint16_t           width,
   }
   if (!format_valid(depth, bpp, unit, format, xpad))
       return 0;
-  image = (xcb_image_t *)malloc(sizeof(*image));
+  image = malloc(sizeof(*image));
   if (image == 0)
       return 0;
   image->width = width;
diff --git a/keysyms/keysyms.c b/keysyms/keysyms.c
index 83c1d3d..4f432d1 100644
--- a/keysyms/keysyms.c
+++ b/keysyms/keysyms.c
@@ -49,7 +49,7 @@ xcb_key_symbols_alloc (xcb_connection_t *c)
   if (!c)
     return NULL;
 
-  syms = (xcb_key_symbols_t *)malloc (sizeof (xcb_key_symbols_t));
+  syms = malloc (sizeof (xcb_key_symbols_t));
 
   syms->c = c;
   syms->tag = TAG_COOKIE;


More information about the Xcb mailing list