GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: a tiny graphical app kit for ruby
Homepage: http://code.whytheluckystiff.net/shoes
Clone URL: git://github.com/why/shoes.git
 * Rakefile: turn on all warnings, solve everything in sight.
 * shoes/ruby.c: of note, a memory leak of PangoAttrLists and no longer 
 ignoring the port number on URLs.
why (author)
Wed Oct 08 21:28:09 -0700 2008
commit  b565f540924ff9ffd56a3871ee2a0b2888d1f2b7
tree    7081217bfce014fc6727696e8a7ae6eb11129c47
parent  7ea3ca2a5dd31f8707e94247763b384c2aa32692
...
313
314
315
316
 
317
318
319
...
313
314
315
 
316
317
318
319
0
@@ -313,7 +313,7 @@ else
0
   PANGO_CFLAGS = ENV['PANGO_CFLAGS'] || `pkg-config --cflags pango`.strip
0
   PANGO_LIB = ENV['PANGO_LIB'] ? "-L#{ENV['PANGO_LIB']}" : `pkg-config --libs pango`.strip
0
 
0
- LINUX_CFLAGS = %[-I#{ENV['SHOES_DEPS_PATH'] || "/usr"}/include #{CAIRO_CFLAGS} #{PANGO_CFLAGS} -I#{Config::CONFIG['archdir']}]
0
+ LINUX_CFLAGS = %[-Wall -I#{ENV['SHOES_DEPS_PATH'] || "/usr"}/include #{CAIRO_CFLAGS} #{PANGO_CFLAGS} -I#{Config::CONFIG['archdir']}]
0
   LINUX_LIB_NAMES = %W[#{ruby_so} png cairo pangocairo-1.0 ungif]
0
   FLAGS.each do |flag|
0
     LINUX_CFLAGS << " -D#{flag}" if ENV[flag]
...
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
...
229
230
231
 
232
233
234
235
236
237
 
238
239
240
241
242
243
 
244
245
246
0
@@ -229,21 +229,18 @@ shoes_app_open(shoes_app *app, char *path)
0
   if (!app->hidden)
0
     shoes_native_app_show(app);
0
 
0
-quit:
0
   return code;
0
 }
0
 
0
 shoes_code
0
 shoes_app_loop()
0
 {
0
- shoes_code code = SHOES_OK;
0
   if (shoes_world->mainloop)
0
     return SHOES_OK;
0
 
0
   shoes_world->mainloop = TRUE;
0
   INFO("RUNNING LOOP.\n");
0
   shoes_native_loop();
0
-quit:
0
   return SHOES_OK;
0
 }
0
 
...
68
69
70
 
71
72
73
...
68
69
70
71
72
73
74
0
@@ -68,6 +68,7 @@ shoes_code shoes_app_release(shoes_app *, int, int, int);
0
 shoes_code shoes_app_wheel(shoes_app *, ID, int, int);
0
 shoes_code shoes_app_keypress(shoes_app *, VALUE);
0
 VALUE shoes_app_close_window(shoes_app *);
0
+VALUE shoes_sys(char *, int);
0
 shoes_code shoes_app_goto(shoes_app *, char *);
0
 shoes_code shoes_slot_repaint(SHOES_SLOT_OS *);
0
 void shoes_app_reset_styles(shoes_app *);
...
24
25
26
27
 
28
29
30
...
172
173
174
175
176
177
178
179
...
410
411
412
413
414
415
416
...
450
451
452
453
454
455
456
...
647
648
649
650
651
652
653
...
666
667
668
669
670
671
672
...
792
793
794
795
 
796
797
798
...
1101
1102
1103
1104
1105
1106
1107
...
1403
1404
1405
1406
1407
1408
1409
...
1758
1759
1760
1761
1762
1763
1764
...
2079
2080
2081
2082
 
2083
2084
2085
...
24
25
26
 
27
28
29
30
...
172
173
174
 
 
175
176
177
...
408
409
410
 
411
412
413
...
447
448
449
 
450
451
452
...
643
644
645
 
646
647
648
...
661
662
663
 
664
665
666
...
786
787
788
 
789
790
791
792
...
1095
1096
1097
 
1098
1099
1100
...
1396
1397
1398
 
1399
1400
1401
...
1750
1751
1752
 
1753
1754
1755
...
2070
2071
2072
 
2073
2074
2075
2076
0
@@ -24,7 +24,7 @@
0
   else if (!NIL_P(image->attr)) attr = rb_funcall(image->attr, s_merge, 1, attr);
0
 #define SETUP_SHAPE() \
0
   shoes_canvas *canvas = NULL; \
0
- VALUE attr, c = shoes_find_canvas(self); \
0
+ VALUE c = shoes_find_canvas(self); \
0
   Data_Get_Struct(c, shoes_canvas, canvas)
0
 
0
 const double SHOES_PIM2 = 6.28318530717958647693;
0
@@ -172,8 +172,6 @@ shoes_canvas_style(int argc, VALUE *argv, VALUE self)
0
 static VALUE
0
 shoes_canvas_paint_call(VALUE self)
0
 {
0
- int n = 0;
0
- shoes_canvas *pc = NULL;
0
   shoes_code code = SHOES_OK;
0
   SHOES_TIME start, mid;
0
   shoes_get_time(&start);
0
@@ -410,7 +408,6 @@ VALUE
0
 shoes_canvas_stroke(int argc, VALUE *argv, VALUE self)
0
 {
0
   VALUE pat;
0
- shoes_pattern *pattern;
0
   SETUP_BASIC();
0
   if (argc == 1 && rb_respond_to(argv[0], s_to_pattern))
0
     pat = argv[0];
0
@@ -450,7 +447,6 @@ VALUE
0
 shoes_canvas_fill(int argc, VALUE *argv, VALUE self)
0
 {
0
   VALUE pat;
0
- shoes_pattern *pattern;
0
   SETUP_BASIC();
0
   if (argc == 1 && rb_respond_to(argv[0], s_to_pattern))
0
     pat = argv[0];
0
@@ -647,7 +643,6 @@ VALUE
0
 shoes_canvas_background(int argc, VALUE *argv, VALUE self)
0
 {
0
   VALUE pat;
0
- shoes_pattern *pattern;
0
   SETUP();
0
   if (argc == 1 && rb_respond_to(argv[0], s_to_pattern))
0
     pat = argv[0];
0
@@ -666,7 +661,6 @@ VALUE
0
 shoes_canvas_border(int argc, VALUE *argv, VALUE self)
0
 {
0
   VALUE pat;
0
- shoes_pattern *pattern;
0
   SETUP();
0
   if (argc == 1 && rb_respond_to(argv[0], s_to_pattern))
0
     pat = argv[0];
0
@@ -792,7 +786,7 @@ shoes_canvas_shape(int argc, VALUE *argv, VALUE self)
0
   SETUP_SHAPE();
0
 
0
   shape = canvas->shape;
0
- attr = shoes_shape_attr(argc, argv, 2, s_left, s_top);
0
+ VALUE attr = shoes_shape_attr(argc, argv, 2, s_left, s_top);
0
   canvas->shape = cairo_create(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 1, 1));
0
   cairo_move_to(canvas->shape, 0, 0);
0
   if (rb_block_given_p()) rb_yield(Qnil);
0
@@ -1101,7 +1095,6 @@ shoes_canvas_independent(shoes_canvas *c)
0
 static void
0
 shoes_canvas_reflow(shoes_canvas *self_t, VALUE c)
0
 {
0
- VALUE attr = Qnil;
0
   shoes_canvas *parent;
0
   Data_Get_Struct(c, shoes_canvas, parent);
0
 
0
@@ -1403,7 +1396,6 @@ shoes_canvas_compute(VALUE self)
0
 static void
0
 shoes_canvas_insert(VALUE self, long i, VALUE ele, VALUE block)
0
 {
0
- VALUE ary;
0
   SETUP();
0
 
0
   if (canvas->insertion != -2)
0
@@ -1758,7 +1750,6 @@ shoes_canvas_send_click2(VALUE self, int button, int x, int y, VALUE *clicked)
0
 VALUE
0
 shoes_canvas_mouse(VALUE self)
0
 {
0
- int x = 0, y = 0, button = 0;
0
   shoes_canvas *self_t;
0
   Data_Get_Struct(self, shoes_canvas, self_t);
0
   return rb_ary_new3(3, INT2NUM(self_t->app->mouseb),
0
@@ -2079,7 +2070,7 @@ shoes_canvas_set_clipboard(VALUE self, VALUE string)
0
 VALUE
0
 shoes_canvas_window(int argc, VALUE *argv, VALUE self)
0
 {
0
- VALUE uri, attr, block, app;
0
+ VALUE uri, attr, block;
0
   SETUP();
0
 
0
   if (rb_block_given_p())
...
27
28
29
30
 
31
32
33
...
188
189
190
191
192
193
194
...
199
200
201
202
203
 
204
205
 
206
207
208
 
209
210
211
212
213
214
 
215
216
217
...
27
28
29
 
30
31
32
33
...
188
189
190
 
191
192
193
...
198
199
200
 
 
201
202
 
203
204
205
 
206
207
208
209
210
211
 
212
213
214
215
0
@@ -27,7 +27,7 @@ box_blur(unsigned char *in, unsigned char *out,
0
   unsigned int edge1, unsigned int edge2,
0
   const unsigned char *run, int dir)
0
 {
0
- int i, j1, j2, l, l2, l3, l4, lx, c1, c2, c3, c4, start;
0
+ int i, j1, j2, l = 0, l2, l3, l4, lx = 0, c1, c2, c3, c4, start;
0
   int boxSize = edge1 + edge2 + 1;
0
   if (dir == BOX_H)
0
   {
0
@@ -188,7 +188,6 @@ static void
0
 shoes_layer_blur_filter(cairo_t *cr, VALUE attr, shoes_place *place,
0
   cairo_operator_t blur_op, cairo_operator_t merge_op, int distance)
0
 {
0
- VALUE bg;
0
   cairo_surface_t *source = cairo_get_target(cr);
0
   int width = cairo_image_surface_get_width(source);
0
   int height = cairo_image_surface_get_height(source);
0
@@ -199,19 +198,18 @@ shoes_layer_blur_filter(cairo_t *cr, VALUE attr, shoes_place *place,
0
   cairo_set_source_surface(cr2, source, distance, distance);
0
   cairo_paint(cr2);
0
   cairo_set_operator(cr2, blur_op);
0
- bg = ATTR(attr, fill);
0
- if (NIL_P(bg))
0
+ if (NIL_P(fill))
0
     cairo_set_source_rgb(cr2, 0., 0., 0.);
0
- else if (rb_obj_is_kind_of(bg, cColor))
0
+ else if (rb_obj_is_kind_of(fill, cColor))
0
   {
0
     shoes_color *color;
0
- Data_Get_Struct(bg, shoes_color, color);
0
+ Data_Get_Struct(fill, shoes_color, color);
0
     cairo_set_source_rgba(cr, color->r / 255., color->g / 255., color->b / 255., color->a / 255.);
0
   }
0
   else
0
   {
0
     shoes_pattern *pattern;
0
- Data_Get_Struct(bg, shoes_pattern, pattern);
0
+ Data_Get_Struct(fill, shoes_pattern, pattern);
0
     cairo_set_source(cr2, PATTERN(pattern));
0
   }
0
   cairo_rectangle(cr2, 0, 0, width, height);
...
180
181
182
183
 
184
185
186
...
180
181
182
 
183
184
185
186
0
@@ -180,7 +180,7 @@ shoes_download(shoes_download_request *req)
0
     cdata.fp = NULL;
0
   }
0
 
0
- HTTP_EVENT(cdata.handler, SHOES_HTTP_COMPLETED, cdata.last, 100, req->size, req->size, cdata.data, req->mem, 1);
0
+ HTTP_EVENT(cdata.handler, SHOES_HTTP_COMPLETED, cdata.last, 100, req->size, req->size, cdata.data, req->mem, goto done);
0
 
0
 done:
0
   if (cdata.fp != NULL)
...
270
271
272
273
274
275
276
...
876
877
878
879
 
880
881
882
...
270
271
272
 
273
274
275
...
875
876
877
 
878
879
880
881
0
@@ -270,7 +270,6 @@ shoes_surface_create_from_gif(char *filename, int *width, int *height, unsigned
0
   ColorMapObject *cmap;
0
   int i, j, bg, r, g, b, w = 0, h = 0, done = 0, transp = -1;
0
   float per = 0.0, per_inc;
0
- int last_per = 0, last_y = 0;
0
   int intoffset[] = { 0, 4, 2, 1 };
0
   int intjump[] = { 8, 8, 4, 2 };
0
 
0
@@ -876,7 +875,7 @@ shoes_load_image(VALUE slot, VALUE imgpath)
0
   cairo_surface_t *img = NULL;
0
   VALUE filename = rb_funcall(imgpath, s_downcase, 0);
0
   char *fname = RSTRING_PTR(filename);
0
- int len = RSTRING_LEN(filename), width = 1, height = 1;
0
+ int width = 1, height = 1;
0
 
0
   if (shoes_cache_lookup(RSTRING_PTR(imgpath), &cached))
0
     goto done;
...
11
12
13
 
14
15
16
...
29
30
31
32
 
33
34
35
...
53
54
55
56
 
57
58
59
60
61
62
63
 
64
65
66
...
198
199
200
201
202
203
204
205
206
207
208
209
210
211
...
242
243
244
245
246
247
248
...
287
288
289
290
291
292
293
...
367
368
369
370
371
372
373
...
11
12
13
14
15
16
17
...
30
31
32
 
33
34
35
36
...
54
55
56
 
57
58
59
60
61
62
63
 
64
65
66
67
...
199
200
201
 
 
 
 
 
 
 
 
202
203
204
...
235
236
237
 
238
239
240
...
279
280
281
 
282
283
284
...
358
359
360
 
361
362
363
0
@@ -11,6 +11,7 @@
0
 
0
 #include <fontconfig/fontconfig.h>
0
 #include <curl/curl.h>
0
+#include <pthread.h>
0
 
0
 #define GTK_CHILD(child, ptr) \
0
   GList *children = gtk_container_get_children(GTK_CONTAINER(ptr)); \
0
@@ -29,7 +30,7 @@ shoes_make_font_list(FcFontSet *fonts, VALUE ary)
0
     FcValue val;
0
     FcPattern *p = fonts->fonts[i];
0
     if (FcPatternGet(p, FC_FAMILY, 0, &val) == FcResultMatch)
0
- rb_ary_push(ary, rb_str_new2(val.u.s));
0
+ rb_ary_push(ary, rb_str_new2((char *)val.u.s));
0
   }
0
   rb_funcall(ary, rb_intern("uniq!"), 0);
0
   rb_funcall(ary, rb_intern("sort!"), 0);
0
@@ -53,14 +54,14 @@ shoes_load_font(const char *filename)
0
 {
0
   FcConfig *fc = FcConfigGetCurrent();
0
   FcFontSet *fonts = FcFontSetCreate();
0
- if (!FcFileScan(fonts, NULL, NULL, NULL, filename, FcTrue))
0
+ if (!FcFileScan(fonts, NULL, NULL, NULL, (const FcChar8 *)filename, FcTrue))
0
     return Qnil;
0
 
0
   VALUE ary = rb_ary_new();
0
   shoes_make_font_list(fonts, ary);
0
   FcFontSetDestroy(fonts);
0
 
0
- if (!FcConfigAppFontAddFile(fc, filename))
0
+ if (!FcConfigAppFontAddFile(fc, (const FcChar8 *)filename))
0
     return Qnil;
0
 
0
   // refresh the FONTS list
0
@@ -198,14 +199,6 @@ void shoes_native_remove_item(SHOES_SLOT_OS *slot, VALUE item, char c)
0
 //
0
 // Window-level events
0
 //
0
-static VALUE
0
-shoes_app_gtk_exception(VALUE v, VALUE exc)
0
-{
0
- if (rb_obj_is_kind_of(exc, rb_eInterrupt))
0
- gtk_main_quit();
0
- return Qnil;
0
-}
0
-
0
 static gboolean
0
 shoes_app_gtk_motion(GtkWidget *widget, GdkEventMotion *event, gpointer data)
0
 {
0
@@ -242,7 +235,6 @@ static gboolean
0
 shoes_app_gtk_wheel(GtkWidget *widget, GdkEventScroll *event, gpointer data)
0
 {
0
   ID wheel;
0
- shoes_canvas *canvas;
0
   shoes_app *app = (shoes_app *)data;
0
   switch (event->direction)
0
   {
0
@@ -287,7 +279,6 @@ shoes_app_gtk_keypress (GtkWidget *widget, GdkEventKey *event, gpointer data)
0
   {
0
     if ((event->state & GDK_CONTROL_MASK) || (event->state & GDK_MOD1_MASK))
0
     {
0
- guint kv;
0
       gint len;
0
       gunichar ch;
0
       char chbuf[7] = {0};
0
@@ -367,7 +358,6 @@ shoes_canvas_gtk_paint_children(GtkWidget *widget, gpointer data)
0
 static void
0
 shoes_canvas_gtk_paint(GtkWidget *widget, GdkEventExpose *event, gpointer data)
0
 {
0
- GtkRequisition req;
0
   VALUE c = (VALUE)data;
0
   shoes_canvas *canvas;
0
   INFO("EXPOSE: (%d, %d) (%d, %d) %lu, %d, %d\n", event->area.x, event->area.y,
...
171
172
173
174
175
176
177
...
343
344
345
346
 
347
348
349
...
367
368
369
370
371
372
373
...
499
500
501
502
503
504
505
...
576
577
578
579
580
581
582
...
611
612
613
614
 
615
616
617
...
810
811
812
813
814
815
816
...
897
898
899
900
901
902
903
...
991
992
993
994
995
996
997
 
 
998
999
1000
...
1068
1069
1070
 
1071
1072
1073
...
1735
1736
1737
1738
1739
1740
1741
...
2359
2360
2361
2362
2363
2364
2365
...
2651
2652
2653
2654
2655
2656
 
2657
2658
2659
...
3047
3048
3049
3050
3051
3052
3053
...
3765
3766
3767
3768
 
3769
3770
3771
...
3779
3780
3781
3782
 
3783
3784
3785
...
3851
3852
3853
3854
 
3855
3856
3857
...
4064
4065
4066
4067
4068
4069
4070
...
171
172
173
 
174
175
176
...
342
343
344
 
345
346
347
348
...
366
367
368
 
369
370
371
...
497
498
499
 
500
501
502
...
573
574
575
 
576
577
578
...
607
608
609
 
610
611
612
613
...
806
807
808
 
809
810
811
...
892
893
894
 
895
896
897
...
985
986
987
 
 
 
 
988
989
990
991
992
...
1060
1061
1062
1063
1064
1065
1066
...
1728
1729
1730
 
1731
1732
1733
...
2351
2352
2353
 
2354
2355
2356
...
2642
2643
2644
 
 
 
2645
2646
2647
2648
...
3036
3037
3038
 
3039
3040
3041
...
3753
3754
3755
 
3756
3757
3758
3759
...
3767
3768
3769
 
3770
3771
3772
3773
...
3839
3840
3841
 
3842
3843
3844
3845
...
4052
4053
4054
 
4055
4056
4057
0
@@ -171,7 +171,6 @@ VALUE
0
 shoes_safe_block(VALUE self, VALUE block, VALUE args)
0
 {
0
   safe_block sb;
0
- shoes_canvas *canvas;
0
   VALUE v;
0
 
0
   sb.canvas = shoes_find_canvas(self);
0
@@ -343,7 +342,7 @@ shoes_place_decide(shoes_place *place, VALUE c, VALUE attr, int dw, int dh, unsi
0
   }
0
   else
0
   {
0
- int cx, cy, ox, oy, tw, th;
0
+ int cx, cy, ox, oy, tw = dw, th = dh;
0
 
0
     if (rel == REL_WINDOW)
0
     {
0
@@ -367,7 +366,6 @@ shoes_place_decide(shoes_place *place, VALUE c, VALUE attr, int dw, int dh, unsi
0
       cx = 0; cy = 0;
0
       ox = CPX(canvas);
0
       oy = CPY(canvas);
0
- tw = dw; th = dh;
0
       testw = dw = CPW(canvas);
0
       dh = max(canvas->height, CPH(canvas));
0
     }
0
@@ -499,7 +497,6 @@ shoes_control_show_ref(SHOES_CONTROL_REF ref)
0
   self_type *self_t; \
0
   shoes_place place; \
0
   shoes_canvas *canvas; \
0
- VALUE ck = rb_obj_class(c); \
0
   Data_Get_Struct(self, self_type, self_t); \
0
   Data_Get_Struct(c, shoes_canvas, canvas); \
0
   if (ATTR(self_t->attr, hidden) == Qtrue) return self; \
0
@@ -576,7 +573,6 @@ shoes_control_show_ref(SHOES_CONTROL_REF ref)
0
     { \
0
       if (!rb_obj_is_kind_of(p, cPattern)) \
0
         ATTRSET(attr, pen, p = rb_funcall(p, s_to_pattern, 0)); \
0
- double r = 0.; \
0
       cairo_matrix_t matrix1, matrix2; \
0
       shoes_pattern *pattern; \
0
       Data_Get_Struct(p, shoes_pattern, pattern); \
0
@@ -611,7 +607,7 @@ shoes_shape_attr(int argc, VALUE *argv, int syms, ...)
0
 {
0
   int i;
0
   va_list args;
0
- VALUE hsh = Qnil, v;
0
+ VALUE hsh = Qnil;
0
   va_start(args, syms);
0
   if (argc < 1) hsh = rb_hash_new();
0
   else if (rb_obj_is_kind_of(argv[argc - 1], rb_cHash)) hsh = argv[argc - 1];
0
@@ -810,7 +806,6 @@ shoes_shape_motion(VALUE self, int x, int y, char *touch)
0
 
0
   if (IS_INSIDE(self_t, x, y))
0
   {
0
- double x1, y1, x2, y2;
0
     cairo_bool_t in_shape;
0
     cairo_t *cr = cairo_create(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 1, 1));
0
     // if (self_t->line != NULL)
0
@@ -897,7 +892,6 @@ shoes_image_free(shoes_image *image)
0
 VALUE
0
 shoes_image_new(VALUE klass, VALUE path, VALUE attr, VALUE parent, shoes_transform *st)
0
 {
0
- GError *error = NULL;
0
   VALUE obj = Qnil;
0
   shoes_image *image;
0
   shoes_basic *basic;
0
@@ -991,10 +985,8 @@ shoes_image_surface_get_pixel(shoes_cached_image *cached, int x, int y)
0
   if (x >= 0 && y >= 0 && x < cached->width && y < cached->height)
0
   {
0
     unsigned char* pixels = cairo_image_surface_get_data(cached->surface);
0
- switch (cairo_image_surface_get_format(cached->surface))
0
- {
0
- case CAIRO_FORMAT_ARGB32: return pixels + (y * (4 * cached->width)) + (4 * x);
0
- }
0
+ if (cairo_image_surface_get_format(cached->surface) == CAIRO_FORMAT_ARGB32)
0
+ return pixels + (y * (4 * cached->width)) + (4 * x);
0
   }
0
   return NULL;
0
 }
0
@@ -1068,6 +1060,7 @@ shoes_image_draw_surface(cairo_t *cr, shoes_image *self_t, shoes_place *place, c
0
 
0
 #define SHOES_IMAGE_PLACE(type, imw, imh, surf) \
0
   SETUP(shoes_##type, REL_CANVAS, imw, imh); \
0
+ VALUE ck = rb_obj_class(c); \
0
   if (RTEST(actual)) \
0
     shoes_image_draw_surface(CCR(canvas), self_t, &place, surf, imw, imh); \
0
   FINISH(); \
0
@@ -1735,7 +1728,6 @@ shoes_color_gradient(int argc, VALUE *argv, VALUE self)
0
 VALUE
0
 shoes_color_gray(int argc, VALUE *argv, VALUE self)
0
 {
0
- shoes_color *color;
0
   VALUE _g, _a;
0
   int g, a;
0
   rb_scan_args(argc, argv, "02", &_g, &_a);
0
@@ -2359,7 +2351,6 @@ shoes_app_style_for(shoes_textblock *block, shoes_app *app, VALUE klass, VALUE o
0
   VALUE hsh = rb_hash_aref(app->styles, klass);
0
   if (NIL_P(hsh) && NIL_P(oattr)) return;
0
 
0
- PangoAttrList *list = pango_attr_list_new();
0
   PangoAttribute *attr = NULL;
0
 
0
   APPLY_STYLE_COLOR(stroke, foreground);
0
@@ -2651,9 +2642,7 @@ shoes_textblock_on_layout(shoes_app *app, VALUE klass, shoes_textblock *block)
0
 VALUE
0
 shoes_textblock_draw(VALUE self, VALUE c, VALUE actual)
0
 {
0
- int px, py, pd, li, m, ld;
0
- double cx, cy;
0
- char *font;
0
+ int px, py, pd, li, ld;
0
   cairo_t *cr;
0
   shoes_canvas *canvas;
0
   PangoLayoutLine *last;
0
@@ -3047,7 +3036,6 @@ VALUE
0
 shoes_list_box_choose(VALUE self, VALUE item)
0
 {
0
   VALUE items = Qnil;
0
- int idx = -1;
0
   GET_STRUCT(control, self_t);
0
   ATTRSET(self_t->attr, choose, item);
0
   if (self_t->ref == NULL) return self;
0
@@ -3765,7 +3753,7 @@ shoes_download_non_threaded(VALUE self, VALUE url)
0
   shoes_download_request req;
0
   SHOE_MEMZERO(&req, shoes_download_request, 1);
0
   req.host = RSTRING_PTR(host);
0
- req.port = 80;
0
+ req.port = NUM2INT(port);
0
   req.path = RSTRING_PTR(path);
0
   req.mem = SHOE_ALLOC_N(char, SHOES_BUFSIZE);
0
   req.memlen = SHOES_BUFSIZE;
0
@@ -3779,7 +3767,7 @@ shoes_download_non_threaded(VALUE self, VALUE url)
0
 int
0
 shoes_message_download(VALUE self, void *data)
0
 {
0
- VALUE proc;
0
+ VALUE proc = Qnil;
0
   shoes_download_event *de = (shoes_download_event *)data;
0
   GET_STRUCT(download_klass, dl);
0
   INFO("EVENT: %d, %lu, %llu, %llu\n", (int)de->stage, de->percent,
0
@@ -3851,7 +3839,7 @@ shoes_download_threaded(VALUE self, VALUE url, VALUE attr)
0
   shoes_download_request *req = SHOE_ALLOC(shoes_download_request);
0
   SHOE_MEMZERO(req, shoes_download_request, 1);
0
   req->host = RSTRING_PTR(host);
0
- req->port = 80;
0
+ req->port = NUM2INT(port);
0
   req->path = RSTRING_PTR(path);
0
   req->handler = shoes_doth_handler;
0
   req->flags = SHOES_DL_DEFAULTS;
0
@@ -4064,7 +4052,6 @@ VALUE progname;
0
 void
0
 shoes_ruby_init()
0
 {
0
- char proc[SHOES_BUFSIZE];
0
   progname = rb_str_new2("(eval)");
0
   rb_define_variable("$0", &progname);
0
   rb_define_variable("$PROGRAM_NAME", &progname);
...
120
121
122
123
124
125
126
...
120
121
122
 
123
124
125
0
@@ -120,7 +120,6 @@ shoes_load_exception(VALUE v, VALUE exc)
0
 shoes_code
0
 shoes_load(char *path)
0
 {
0
- shoes_code code = SHOES_QUIT;
0
   char bootup[SHOES_BUFSIZE];
0
 
0
   if (path)

Comments

    No one has commented yet.