Date: | 2012-05-28 08:11:15 (11 years 10 months ago) |
---|---|
Author: | Werner Almesberger |
Commit: | f2d3986600ad5722b1f2fd4f71a5495dcc540447 |
Message: | fix whitespace anomalies / \t/, / $/, and /\t$/ |
Files: |
coord.c (1 diff) expr.c (2 diffs) fpd.l (1 diff) fpd.y (2 diffs) gui.c (3 diffs) gui_frame.c (3 diffs) gui_frame.h (1 diff) gui_frame_drag.c (2 diffs) gui_inst.c (1 diff) gui_status.c (2 diffs) gui_util.c (1 diff) inst.c (1 diff) inst.h (2 diffs) kicad.c (1 diff) meas.h (1 diff) overlap.c (1 diff) postscript.c (1 diff) unparse.c (1 diff) util.c (1 diff) |
Change Details
coord.c | ||
---|---|---|
112 | 112 | |
113 | 113 | struct coord neg_vec(struct coord v) |
114 | 114 | { |
115 | v.x = -v.x; | |
115 | v.x = -v.x; | |
116 | 116 | v.y = -v.y; |
117 | 117 | return v; |
118 | 118 | } |
expr.c | ||
---|---|---|
330 | 330 | if (is_undef(res)) |
331 | 331 | return undef; |
332 | 332 | if (!is_dimensionless(res)) { |
333 | fail("angle must be dimensionless"); | |
333 | fail("angle must be dimensionless"); | |
334 | 334 | return undef; |
335 | 335 | } |
336 | 336 | res.n = fn(res.n/180.0*M_PI); |
... | ... | |
358 | 358 | if (is_undef(res)) |
359 | 359 | return undef; |
360 | 360 | if (res.exponent & 1) { |
361 | fail("exponent of sqrt argument must be a multiple of two"); | |
361 | fail("exponent of sqrt argument must be a multiple of two"); | |
362 | 362 | return undef; |
363 | 363 | } |
364 | 364 | if (res.n < 0) { |
365 | fail("argument of sqrt must be positive"); | |
365 | fail("argument of sqrt must be positive"); | |
366 | 366 | return undef; |
367 | 367 | } |
368 | 368 | res.n = sqrt(res.n); |
fpd.l | ||
---|---|---|
192 | 192 | |
193 | 193 | ^#\ [0-9]+\ \"[^"]*\"(\ [0-9]+)*\n { |
194 | 194 | if (!disable_keywords) |
195 | BEGIN(INITIAL); | |
195 | BEGIN(INITIAL); | |
196 | 196 | lineno = strtol(yytext+2, NULL, 0); } |
197 | 197 | |
198 | 198 | . return *yytext; |
fpd.y | ||
---|---|---|
773 | 773 | n_vars++; |
774 | 774 | } |
775 | 775 | ; |
776 | ||
776 | ||
777 | 777 | opt_key: |
778 | 778 | { |
779 | 779 | $$ = 0; |
... | ... | |
973 | 973 | $$->u.arc.end = $4; |
974 | 974 | $$->u.arc.width = $5; |
975 | 975 | } |
976 | | TOK_FRAME ID | |
977 | { | |
976 | | TOK_FRAME ID | |
977 | { | |
978 | 978 | $<num>$.n = lineno; |
979 | 979 | } |
980 | 980 | base |
gui.c | ||
---|---|---|
94 | 94 | |
95 | 95 | |
96 | 96 | static GtkItemFactoryEntry menu_entries[] = { |
97 | { "/File", NULL, NULL, 0, "<Branch>" }, | |
97 | { "/File", NULL, NULL, 0, "<Branch>" }, | |
98 | 98 | { "/File/Save", NULL, save_fpd, 0, "<Item>" }, |
99 | 99 | { "/File/Save as", NULL, save_as_fpd, 0, "<Item>" }, |
100 | 100 | { "/File/sep1", NULL, NULL, 0, "<Separator>" }, |
... | ... | |
277 | 277 | |
278 | 278 | paned = gtk_hpaned_new(); |
279 | 279 | gtk_box_pack_start(GTK_BOX(hbox), paned, TRUE, TRUE, 0); |
280 | ||
280 | ||
281 | 281 | /* Frames */ |
282 | 282 | |
283 | 283 | frames_area = gtk_scrolled_window_new(NULL, NULL); |
... | ... | |
338 | 338 | after = inst_get_bbox(); |
339 | 339 | label_in_box_bg(active_frame->label, COLOR_FRAME_SELECTED); |
340 | 340 | do_build_frames(); |
341 | if (after.min.x < before.min.x || after.min.y < before.min.y || | |
341 | if (after.min.x < before.min.x || after.min.y < before.min.y || | |
342 | 342 | after.max.x > before.max.x || after.max.y > before.max.y) |
343 | 343 | zoom_to_extents(); |
344 | 344 | else |
gui_frame.c | ||
---|---|---|
208 | 208 | can_add_frame()); |
209 | 209 | |
210 | 210 | enable_add_var(frame, factory_frame); |
211 | ||
211 | ||
212 | 212 | pop_up(popup_frame_widget, event, frame); |
213 | 213 | } |
214 | 214 | |
... | ... | |
1038 | 1038 | gtk_table_set_row_spacings(GTK_TABLE(tab), 1); |
1039 | 1039 | gtk_table_set_col_spacings(GTK_TABLE(tab), 1); |
1040 | 1040 | } |
1041 | ||
1041 | ||
1042 | 1042 | name = stralloc_printf("%s%s", var->key ? "?" : "", var->name); |
1043 | 1043 | field = label_in_box_new(name, |
1044 | 1044 | "Variable (column) name. Click to edit."); |
... | ... | |
1122 | 1122 | n_var++; |
1123 | 1123 | n_vars++; |
1124 | 1124 | } |
1125 | ||
1126 | 1125 | } |
1127 | 1126 | |
1128 | 1127 |
gui_frame.h | ||
---|---|---|
22 | 22 | extern int show_vars; |
23 | 23 | |
24 | 24 | |
25 | int find_var_in_frame(const struct frame *frame, const char *name, | |
25 | int find_var_in_frame(const struct frame *frame, const char *name, | |
26 | 26 | const struct var *self); |
27 | 27 | void reselect_var(struct var *var); |
28 | 28 |
gui_frame_drag.c | ||
---|---|---|
86 | 86 | NDX_n++; \ |
87 | 87 | NDX_n; }) |
88 | 88 | |
89 | #define NTH(first, n) \ | |
89 | #define NTH(first, n) \ | |
90 | 90 | ({ typeof(first) *NTH_walk; \ |
91 | 91 | int NTH_n = (n); \ |
92 | 92 | for (NTH_walk = &(first); NTH_n; NTH_n--) \ |
... | ... | |
164 | 164 | b = pick_table_cell(table_b, b_col, b_row); |
165 | 165 | if (a) { |
166 | 166 | g_object_ref(a); |
167 | gtk_container_remove(GTK_CONTAINER(table_a), a); | |
167 | gtk_container_remove(GTK_CONTAINER(table_a), a); | |
168 | 168 | } |
169 | 169 | if (b) { |
170 | 170 | g_object_ref(b); |
171 | gtk_container_remove(GTK_CONTAINER(table_b), b); | |
171 | gtk_container_remove(GTK_CONTAINER(table_b), b); | |
172 | 172 | } |
173 | 173 | if (a) |
174 | 174 | gtk_table_attach_defaults(GTK_TABLE(table_b), a, |
gui_inst.c | ||
---|---|---|
561 | 561 | abort(); |
562 | 562 | } |
563 | 563 | return stralloc_printf(mm ? |
564 | "%s" MM_FORMAT_SHORT "%s" : | |
564 | "%s" MM_FORMAT_SHORT "%s" : | |
565 | 565 | "%s" MIL_FORMAT_SHORT "%s", |
566 | 566 | label, n, u); |
567 | 567 | } |
gui_status.c | ||
---|---|---|
431 | 431 | }; |
432 | 432 | |
433 | 433 | |
434 | void edit_unique(const char **s, int (*validate)(const char *s, void *ctx), | |
434 | void edit_unique(const char **s, int (*validate)(const char *s, void *ctx), | |
435 | 435 | void *ctx, const char *tooltip) |
436 | 436 | { |
437 | 437 | static struct edit_unique_ctx unique_ctx; |
... | ... | |
1055 | 1055 | status_entry_y = add_entry(tab, 2, 1); |
1056 | 1056 | |
1057 | 1057 | status_entry_x = gtk_widget_ref(make_entry()); |
1058 | ||
1058 | ||
1059 | 1059 | /* name and input */ |
1060 | 1060 | |
1061 | 1061 | status_name = add_label(tab, 1, 2); |
gui_util.c | ||
---|---|---|
223 | 223 | gboolean (*cb)(GtkWidget *widget, GdkEventButton *event, gpointer data), |
224 | 224 | gpointer data) |
225 | 225 | { |
226 | GtkWidget *image, *evbox; | |
226 | GtkWidget *image, *evbox; | |
227 | 227 | GtkToolItem *item; |
228 | 228 | |
229 | 229 | /* |
inst.c | ||
---|---|---|
283 | 283 | best_dist = dist; |
284 | 284 | } |
285 | 285 | } |
286 | ||
286 | ||
287 | 287 | if (selected_inst) |
288 | 288 | goto selected; |
289 | 289 | } |
inst.h | ||
---|---|---|
59 | 59 | void (*save)(FILE *file, struct inst *self); |
60 | 60 | void (*draw)(struct inst *self); |
61 | 61 | struct pix_buf *(*hover)(struct inst *self); |
62 | unit_type (*distance)(struct inst *self, struct coord pos, | |
62 | unit_type (*distance)(struct inst *self, struct coord pos, | |
63 | 63 | unit_type scale); |
64 | 64 | void (*select)(struct inst *self); |
65 | 65 | void (*begin_drag_move)(struct inst *from, int i); |
... | ... | |
207 | 207 | void inst_draw(void); |
208 | 208 | void inst_highlight_vecs(int (*pick)(struct inst *inst, void *user), |
209 | 209 | void *user); |
210 | struct inst *inst_find_vec(struct coord pos, | |
210 | struct inst *inst_find_vec(struct coord pos, | |
211 | 211 | int (*pick)(struct inst *inst, void *user), void *user); |
212 | 212 | struct inst *insts_ip_vec(void); |
213 | 213 |
kicad.c | ||
---|---|---|
77 | 77 | |
78 | 78 | /* |
79 | 79 | * name, shape (rectangle), Xsize, Ysize, Xdelta, Ydelta, Orientation |
80 | */ | |
80 | */ | |
81 | 81 | fprintf(file, "Sh \"%s\" %c %d %d 0 0 0\n", |
82 | 82 | inst->u.pad.name, inst->obj->u.pad.rounded ? 'O' : 'R', |
83 | 83 | size.x, size.y); |
meas.h | ||
---|---|---|
45 | 45 | /* low is obj->base */ |
46 | 46 | struct vec *high; |
47 | 47 | struct expr *offset; |
48 | ||
48 | ||
49 | 49 | /* frame qualifiers */ |
50 | 50 | struct frame_qual *low_qual; |
51 | 51 | struct frame_qual *high_qual; |
overlap.c | ||
---|---|---|
40 | 40 | abort(); |
41 | 41 | } |
42 | 42 | sort_coord(&min_a, &max_a); |
43 | ||
43 | ||
44 | 44 | min_b = b->base; |
45 | 45 | switch (b->obj->type) { |
46 | 46 | case ot_pad: |
postscript.c | ||
---|---|---|
654 | 654 | * quantitative one, emphasizing the logical structure of the drawing |
655 | 655 | * and not the actual sizes. |
656 | 656 | * |
657 | * This could be done by ranking vectors by current, average, maximum, | |
657 | * This could be done by ranking vectors by current, average, maximum, | |
658 | 658 | * etc. size, then let their size be determined by the amount of text |
659 | 659 | * that's needed and the size of subordinate vectors. One difficulty |
660 | 660 | * would be in making vectors with a fixed length ratio look correct, |
unparse.c | ||
---|---|---|
88 | 88 | char tmp[100]; |
89 | 89 | char *buf, *temp; |
90 | 90 | |
91 | ||
92 | 91 | if (prec > precedence(expr->op)) { |
93 | 92 | temp = unparse_op(expr, prec_add); |
94 | 93 | buf = alloc_size(strlen(temp)+3); |
util.c | ||
---|---|---|
52 | 52 | /* ----- identifier syntax check ------------------------------------------- */ |
53 | 53 | |
54 | 54 | |
55 | int is_id_char(char c, int first) | |
55 | int is_id_char(char c, int first) | |
56 | 56 | { |
57 | 57 | if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_') |
58 | 58 | return 1; |
Branches:
master