Re: GTK3 porting problem (clipboard)



On Fri, Mar 11, 2011 at 11:42:12AM +0100, Jaroslav ÅmÃd wrote:
GtkTargetEntry targets[] = {
  {"text/html", 0, 0},
  {"text/plain", 0, 0}
};

size_t num_targets = sizeof(targets) / sizeof(targets[]);

// This IS required no matter what, or your program WILL BE broken
if (sizeof(size_t) > sizeof(guint) && num_targets > (size_t)G_MAX_GUINT) {
  // fail here because of stupid decision to use guint instead of size_t
  // this might get optimised away by compiler (condition is know to be  
false/true during compile-time
}

You are no fun any more.

Yeti




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]