better identify commented pieces of code
This commit is contained in:
parent
05af59ac9d
commit
95c0ad1572
|
|
@ -59,50 +59,52 @@ void print_version()
|
|||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
char *escape_chars(char *dest, const char *source, int size)
|
||||
{
|
||||
int s=0;
|
||||
int d=0;
|
||||
size--; /* reserve space for \0 */
|
||||
while(source && source[s]) {
|
||||
switch(source[s]) {
|
||||
case '\n':
|
||||
if(d < size-1) {
|
||||
dest[d++] = '\\';
|
||||
dest[d++] = 'n';
|
||||
}
|
||||
break;
|
||||
case '\t':
|
||||
if(d < size-1) {
|
||||
dest[d++] = '\\';
|
||||
dest[d++] = 't';
|
||||
}
|
||||
break;
|
||||
case '\\':
|
||||
case '\'':
|
||||
case ' ':
|
||||
case ';':
|
||||
case '$':
|
||||
case '!':
|
||||
case '#':
|
||||
case '{':
|
||||
case '}':
|
||||
case '[':
|
||||
case ']':
|
||||
case '"':
|
||||
if(d < size-1) {
|
||||
dest[d++] = '\\';
|
||||
dest[d++] = source[s];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if(d < size) dest[d++] = source[s];
|
||||
}
|
||||
s++;
|
||||
}
|
||||
dest[d] = '\0';
|
||||
return dest;
|
||||
}
|
||||
#if 0
|
||||
* char *escape_chars(char *dest, const char *source, int size)
|
||||
* {
|
||||
* int s=0;
|
||||
* int d=0;
|
||||
* size--; /* reserve space for \0 */
|
||||
* while(source && source[s]) {
|
||||
* switch(source[s]) {
|
||||
* case '\n':
|
||||
* if(d < size-1) {
|
||||
* dest[d++] = '\\';
|
||||
* dest[d++] = 'n';
|
||||
* }
|
||||
* break;
|
||||
* case '\t':
|
||||
* if(d < size-1) {
|
||||
* dest[d++] = '\\';
|
||||
* dest[d++] = 't';
|
||||
* }
|
||||
* break;
|
||||
* case '\\':
|
||||
* case '\'':
|
||||
* case ' ':
|
||||
* case ';':
|
||||
* case '$':
|
||||
* case '!':
|
||||
* case '#':
|
||||
* case '{':
|
||||
* case '}':
|
||||
* case '[':
|
||||
* case ']':
|
||||
* case '"':
|
||||
* if(d < size-1) {
|
||||
* dest[d++] = '\\';
|
||||
* dest[d++] = source[s];
|
||||
* }
|
||||
* break;
|
||||
* default:
|
||||
* if(d < size) dest[d++] = source[s];
|
||||
* }
|
||||
* s++;
|
||||
* }
|
||||
* dest[d] = '\0';
|
||||
* return dest;
|
||||
* }
|
||||
#endif
|
||||
|
||||
void set_snap(double newsnap) /* 20161212 set new snap factor and just notify new value */
|
||||
{
|
||||
|
|
|
|||
10
src/draw.c
10
src/draw.c
|
|
@ -68,11 +68,11 @@ void print_image()
|
|||
else return;
|
||||
}
|
||||
#if 0
|
||||
for(tmp=0;tmp<cadlayers;tmp++) {
|
||||
XSetClipRectangles(display, gc[tmp], 0,0, xctx->xrect, 1, Unsorted);
|
||||
XSetClipRectangles(display, gcstipple[tmp], 0,0, xctx->xrect, 1, Unsorted);
|
||||
}
|
||||
XSetClipRectangles(display, xctx->gctiled, 0,0, xctx->xrect, 1, Unsorted);
|
||||
* for(tmp=0;tmp<cadlayers;tmp++) {
|
||||
* XSetClipRectangles(display, gc[tmp], 0,0, xctx->xrect, 1, Unsorted);
|
||||
* XSetClipRectangles(display, gcstipple[tmp], 0,0, xctx->xrect, 1, Unsorted);
|
||||
* }
|
||||
* XSetClipRectangles(display, xctx->gctiled, 0,0, xctx->xrect, 1, Unsorted);
|
||||
#endif
|
||||
save_draw_grid = draw_grid;
|
||||
draw_grid=0;
|
||||
|
|
|
|||
|
|
@ -25,24 +25,24 @@
|
|||
#define Y_TO_PS(y) ( (y+xctx->yorigin)* xctx->mooz )
|
||||
|
||||
#if 0
|
||||
/* FIXME: overflow check. Not used, BTW */
|
||||
static char *strreplace(char s[], char token[], char replace[])
|
||||
{
|
||||
static char res[200];
|
||||
char *p1, *p2;
|
||||
int l;
|
||||
|
||||
res[0] = '\0';
|
||||
l = strlen(token);
|
||||
p1 = p2 = s;
|
||||
while( (p2 = strstr(p1, token)) ) {
|
||||
strncat(res, p1, p2 - p1);
|
||||
strcat(res, replace);
|
||||
p1 = p2 = p2 + l;
|
||||
}
|
||||
strcat(res, p1);
|
||||
return res;
|
||||
}
|
||||
* /* FIXME: overflow check. Not used, BTW */
|
||||
* static char *strreplace(char s[], char token[], char replace[])
|
||||
* {
|
||||
* static char res[200];
|
||||
* char *p1, *p2;
|
||||
* int l;
|
||||
*
|
||||
* res[0] = '\0';
|
||||
* l = strlen(token);
|
||||
* p1 = p2 = s;
|
||||
* while( (p2 = strstr(p1, token)) ) {
|
||||
* strncat(res, p1, p2 - p1);
|
||||
* strcat(res, replace);
|
||||
* p1 = p2 = p2 + l;
|
||||
* }
|
||||
* strcat(res, p1);
|
||||
* return res;
|
||||
* }
|
||||
#endif
|
||||
|
||||
char *utf8_enc[]={
|
||||
|
|
|
|||
|
|
@ -602,46 +602,46 @@ void svg_draw(void)
|
|||
|
||||
unused_layer = my_calloc(873, cadlayers, sizeof(int));
|
||||
#if 0
|
||||
/* Determine used layers. Disabled since we want hilight colors */
|
||||
for(c=0;c<cadlayers;c++) unused_layer[c] = 1;
|
||||
unused_layer[0] = 0; /* background */
|
||||
for(i=0;i<xctx->texts;i++)
|
||||
{
|
||||
textlayer = xctx->text[i].layer;
|
||||
if(textlayer < 0 || textlayer >= cadlayers) textlayer = TEXTLAYER;
|
||||
unused_layer[textlayer] = 0;
|
||||
}
|
||||
for(c=0;c<cadlayers;c++)
|
||||
{
|
||||
xSymbol symptr = (xctx->inst[i].ptr + xctx->sym);
|
||||
if(xctx->lines[c] || xctx->rects[c] || xctx->arcs[c] || xctx->polygons[c]) unused_layer[c] = 0;
|
||||
if(xctx->wires) unused_layer[WIRELAYER] = 0;
|
||||
for(i=0;i<xctx->instances;i++) {
|
||||
if( (c == PINLAYER || enable_layer[c]) && symptr->lines[c] ) unused_layer[c] = 0;
|
||||
if( (c == PINLAYER || enable_layer[c]) && symptr->polygons[c] ) unused_layer[c] = 0;
|
||||
if( (c == PINLAYER || enable_layer[c]) && symptr->arcs[c] ) unused_layer[c] = 0;
|
||||
if( (c != PINLAYER || enable_layer[c]) && symptr->rects[c] ) unused_layer[c] = 0;
|
||||
if( (c==TEXTWIRELAYER && !(xctx->inst[i].flags&2) ) ||
|
||||
(sym_txt && (c==TEXTLAYER) && (xctx->inst[i].flags&2) ) )
|
||||
{
|
||||
int j;
|
||||
for(j=0;j< symptr->texts;j++)
|
||||
{
|
||||
textlayer = c;
|
||||
if( !(xctx->inst[i].color == PINLAYER)) {
|
||||
textlayer = symptr->text[j].layer;
|
||||
if(textlayer < 0 || textlayer >= cadlayers) textlayer = c;
|
||||
}
|
||||
/* display PINLAYER colored instance texts even if PINLAYER disabled */
|
||||
if(xctx->inst[i].color == PINLAYER || enable_layer[textlayer]) {
|
||||
used_layer[textlayer] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
dbg(1, "used_layer[%d] = %d\n", c, used_layer[c]);
|
||||
}
|
||||
/* End determine used layer */
|
||||
* /* Determine used layers. Disabled since we want hilight colors */
|
||||
* for(c=0;c<cadlayers;c++) unused_layer[c] = 1;
|
||||
* unused_layer[0] = 0; /* background */
|
||||
* for(i=0;i<xctx->texts;i++)
|
||||
* {
|
||||
* textlayer = xctx->text[i].layer;
|
||||
* if(textlayer < 0 || textlayer >= cadlayers) textlayer = TEXTLAYER;
|
||||
* unused_layer[textlayer] = 0;
|
||||
* }
|
||||
* for(c=0;c<cadlayers;c++)
|
||||
* {
|
||||
* xSymbol symptr = (xctx->inst[i].ptr + xctx->sym);
|
||||
* if(xctx->lines[c] || xctx->rects[c] || xctx->arcs[c] || xctx->polygons[c]) unused_layer[c] = 0;
|
||||
* if(xctx->wires) unused_layer[WIRELAYER] = 0;
|
||||
* for(i=0;i<xctx->instances;i++) {
|
||||
* if( (c == PINLAYER || enable_layer[c]) && symptr->lines[c] ) unused_layer[c] = 0;
|
||||
* if( (c == PINLAYER || enable_layer[c]) && symptr->polygons[c] ) unused_layer[c] = 0;
|
||||
* if( (c == PINLAYER || enable_layer[c]) && symptr->arcs[c] ) unused_layer[c] = 0;
|
||||
* if( (c != PINLAYER || enable_layer[c]) && symptr->rects[c] ) unused_layer[c] = 0;
|
||||
* if( (c==TEXTWIRELAYER && !(xctx->inst[i].flags&2) ) ||
|
||||
* (sym_txt && (c==TEXTLAYER) && (xctx->inst[i].flags&2) ) )
|
||||
* {
|
||||
* int j;
|
||||
* for(j=0;j< symptr->texts;j++)
|
||||
* {
|
||||
* textlayer = c;
|
||||
* if( !(xctx->inst[i].color == PINLAYER)) {
|
||||
* textlayer = symptr->text[j].layer;
|
||||
* if(textlayer < 0 || textlayer >= cadlayers) textlayer = c;
|
||||
* }
|
||||
* /* display PINLAYER colored instance texts even if PINLAYER disabled */
|
||||
* if(xctx->inst[i].color == PINLAYER || enable_layer[textlayer]) {
|
||||
* used_layer[textlayer] = 0;
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* dbg(1, "used_layer[%d] = %d\n", c, used_layer[c]);
|
||||
* }
|
||||
* /* End determine used layer */
|
||||
#endif
|
||||
|
||||
fprintf(fd, "<svg xmlns=\"http://www.w3.org/2000/svg\""
|
||||
|
|
|
|||
32
src/token.c
32
src/token.c
|
|
@ -1822,22 +1822,22 @@ void print_spice_element(FILE *fd, int inst)
|
|||
}
|
||||
|
||||
|
||||
/* can't remember what the f**k this is supposed to do.
|
||||
why eval( and not tcleval( ?
|
||||
disable until some regression pops out
|
||||
*/
|
||||
#if 0
|
||||
/* do a second round of substitutions, but without calling tcl */
|
||||
if(result && strstr(result, "eval(") == result) {
|
||||
char *c = strrchr(result, ')');
|
||||
if(c) while(1) { /* shift following characters back 1 char */
|
||||
*c = c[1];
|
||||
c++;
|
||||
if(!*c) break;
|
||||
}
|
||||
my_strdup2(88, &result, translate(inst, result+5));
|
||||
}
|
||||
#endif
|
||||
/* can't remember what the f**k this is supposed to do.
|
||||
why eval( and not tcleval( ?
|
||||
disable until some regression pops out
|
||||
*/
|
||||
#if 0
|
||||
* /* do a second round of substitutions, but without calling tcl */
|
||||
* if(result && strstr(result, "eval(") == result) {
|
||||
* char *c = strrchr(result, ')');
|
||||
* if(c) while(1) { /* shift following characters back 1 char */
|
||||
* *c = c[1];
|
||||
* c++;
|
||||
* if(!*c) break;
|
||||
* }
|
||||
* my_strdup2(88, &result, translate(inst, result+5));
|
||||
* }
|
||||
#endif
|
||||
|
||||
|
||||
fprintf(fd, "%s", result);
|
||||
|
|
|
|||
10
src/xinit.c
10
src/xinit.c
|
|
@ -964,11 +964,11 @@ void resetcairo(int create, int clear, int force_or_resize)
|
|||
cairo_set_line_join(xctx->cairo_ctx, CAIRO_LINE_JOIN_ROUND);
|
||||
cairo_set_line_cap(xctx->cairo_ctx, CAIRO_LINE_CAP_ROUND);
|
||||
#if 0
|
||||
#if HAS_XCB==1 && HAS_XRENDER==1
|
||||
cairo_xcb_surface_set_size(xctx->cairo_sfc, xctx->xschem_w, xctx->xschem_h);
|
||||
#else
|
||||
cairo_xlib_surface_set_size(xctx->cairo_sfc, xctx->xschem_w, xctx->xschem_h);
|
||||
#endif /* HAS_XCB && HAS_XRENDER */
|
||||
* #if HAS_XCB==1 && HAS_XRENDER==1
|
||||
* cairo_xcb_surface_set_size(xctx->cairo_sfc, xctx->xschem_w, xctx->xschem_h);
|
||||
* #else
|
||||
* cairo_xlib_surface_set_size(xctx->cairo_sfc, xctx->xschem_w, xctx->xschem_h);
|
||||
* #endif /* HAS_XCB && HAS_XRENDER */
|
||||
#endif
|
||||
}
|
||||
#endif /* HAS_CAIRO */
|
||||
|
|
|
|||
|
|
@ -1103,7 +1103,7 @@ extern void new_prop_string(int i, const char *old_prop,int fast, int dis_uniq_n
|
|||
extern void hash_name(char *token, int remove);
|
||||
extern void hash_all_names(int n);
|
||||
extern void symbol_bbox(int i, double *x1,double *y1, double *x2, double *y2);
|
||||
extern char *escape_chars(char *dest, const char *source, int size);
|
||||
/* extern char *escape_chars(char *dest, const char *source, int size); */
|
||||
|
||||
extern void set_inst_prop(int i);
|
||||
extern void unselect_wire(int i);
|
||||
|
|
|
|||
Loading…
Reference in New Issue