shithub: fc

Download patch

ref: c9863396b9ad946e288b4bc88eb1363e7137ef4a
parent: c5d556434652b8f00fb0ec89fe2d1fc162f5e4c5
author: glenda <glenda@krsna>
date: Sat Aug 16 15:58:54 EDT 2025

cleaningup

--- a/fc.c
+++ b/fc.c
@@ -44,8 +44,8 @@
 	OP_NE = '!',
 	OP_LT = '<',
 	OP_GT = '>',
-	OP_LE = '[',  /* Using [ for <= */
-	OP_GE = ']',  /* Using ] for >= */
+	OP_LE = '[',  /* for <= */
+	OP_GE = ']',  /* for >= */
 	
 	FN_SUM = 0,
 	FN_AVG,
@@ -98,7 +98,7 @@
 	int		entering_filename;	
 	char	filenamebuf[256];
 	int		filenamepos;		
-	int		save_mode;		/* 1=save, 2=load */
+	int		save_mode;	
 	int		current_mode;
 	Point	offset;	
 	int		needredraw;
@@ -119,9 +119,9 @@
 	int	type;
 	union {
 		double	num;
-		int	cell;			/* box index */
+		int	cell;		
 		struct {
-			int start, end;	/* range of boxes */
+			int start, end;
 		} range;
 		int		op;
 		int		func;
@@ -147,13 +147,13 @@
 };
 
 typedef void (*KeyHandler)(int key);
-typedef void (*MouseHandler)(Mouse m); /* For data-oriented mouse handling */
+typedef void (*MouseHandler)(Mouse m);
 
 typedef struct InputMode InputMode;
 struct InputMode {
 	char		*name;
 	KeyHandler	handler;
-	MouseHandler mouse_handler; /* Added mouse handler */
+	MouseHandler mouse_handler;
 	void		(*draw)(void);
 	char		*status;
 };
@@ -167,13 +167,13 @@
 typedef struct EditAction EditAction;
 struct EditAction {
 	int		key;
-	int		(*action)(char *buf, int *pos, int maxlen);  /* Returns 1 to exit mode */
+	int		(*action)(char *buf, int *pos, int maxlen); 
 };
 
 typedef struct DrawStep DrawStep;
 struct DrawStep {
 	void (*draw)(void);
-	int  condition;  /* 0=always, 1=if grid, etc */
+	int  condition; 
 };
 
 Image	*colors[6];
@@ -292,15 +292,15 @@
 	{'\n',	edit_finish},
 	{Kesc,	edit_cancel},
 	{Kbs,	edit_backspace},
-	{-1,	edit_add_char},  /* Default for any other key */
+	{-1,	edit_add_char}, 
 	{0, nil}
 };
 
 DrawStep draw_steps[] = {
-	{draw_background,	0},  /* Always */
-	{draw_grid_lines,	1},  /* If gridsnap */
-	{draw_all_boxes,	0},  /* Always */
-	{draw_status_line,	0},  /* Always */
+	{draw_background,	0}, 
+	{draw_grid_lines,	1}, 
+	{draw_all_boxes,	0},  
+	{draw_status_line,	0}, 
 	{nil, 0}
 };
 
@@ -576,7 +576,6 @@
 	}
 }
 
-/* Evaluate primary expression (number, cell, function call, parentheses) */
 double
 eval_primary(Eval *e)
 {
@@ -1065,7 +1064,6 @@
 	}
 }
 
-/* Recalculate all formulas in dependency order */
 void
 recalc_all(void)
 {
--