Commit Graph

13 Commits

Author SHA1 Message Date
Mike Sharov 23a08804f8 Run code through indent
This mainly changes the indentation level from 8 to 4 spaces,
because I have difficulty working with the wide indents.
There should be no non-whitespace changes here.
2021-04-09 17:56:41 -04:00
Mike Sharov 6476478c9a Fix clang's warnings about syslog format security 2018-05-02 09:56:08 -04:00
Mike Sharov 58e8344a82 Add SNOWNEWS_CONFIG_DIR and SNOWNEWS_CACHE_DIR in config.h to replace hardcoded paths 2018-04-30 15:41:50 -04:00
Mike Sharov 37417ab434 Reduce writes to ~/.snownews
Write configuration files only when changed
	Write cache file only when the feed changes
	Write pid lockfile to XDG_RUNTIME_DIR, if available
2018-04-30 15:30:36 -04:00
Mike Sharov 110145fe13 Remove output to error.log file
This was used only to report http errors. These are already
	printed as part of feed status, and on the status bar after
	the error occured. This commit changes to syslog calls.
2018-04-30 12:53:02 -04:00
Mike Sharov abf9966f5c Sort struct members by type to improve packing
Improve member naming, such as next_ptr to next, override to custom_title, etc.
2018-04-30 11:40:24 -04:00
Mike Sharov 24a28f44d0 Move all global variabls to main.c
Move all global struct definitions to main.h
Merge all global settings into struct settings
Prefix all global variables with _ to emphasize they are global
2018-04-30 11:15:42 -04:00
Mike Sharov d90b962ba3 Merge support.c into about.c. This fixes #17.
Remove check for santa_hunta file.
Add 'S' hotkey in about screen instead.
2018-04-30 10:00:21 -04:00
Mike Sharov 5359416458 General cleanup
Reduce variable scope
	Make functions static when possible
	Make vars const when possible
	Make vars unsigned when possible
	Use bool type from stdbool.h
	Rename some confusingly named variables (i.e. tmp, tmp2)
    	Prefer stack storage to same-scope malloc/free
	Prefer enums for constants
	Prefer sprintf to strcat and other tricks
	Simplify redundant blocks
	Simplify strtok flow
	Remove unnecessary parentheses and braces
	Replace some magic constants with clearer alternatives
	Remove libm dependency (log10 in about.c)
	Make highlight logic in interface.c more consistent
	Fix wrong item being hashed in digcalc
	Remove clear to reduce flicker
	Use = {} for zero-initializing
	Use calloc instead of malloc/manual zeroing
	Make MainQuit be called with an error in a signal handler
	Fix file opening modes to match intended use
	Read and display error log in window instead of using pager
	Remove non-ascii characters from setup.c; replace with hex codes
2018-04-30 09:47:10 -04:00
Mike Sharov cea1dafb04 Convert all block comments to line comments.
Remove non-ascii characters from source, replace with hex printf.
Translate german comments to english.
Remove profanity from comments.
2018-04-27 10:47:43 -04:00
Mike Sharov f1a7b649f6 Update copyright headers to current recommendations
Recommended header wording copied from https://www.gnu.org/licenses/gpl-howto.html
	The only two changes are to use the project name, Snownews,
	instead of "this program", to clarify that the entire project is
	under the GPL license, rather than only the file with the header.
	The second change is to replace snail mail address with the license
	URL. It is unreasonable to expect users to send an actual letter to
	a US address if the user is in, say, Germany. Postage is expensive.
2018-04-27 09:31:21 -04:00
Koz 0f7c424f3f Relicensing to GPL-3.0 2017-10-24 11:37:27 +13:00
Oliver Feiler 486fa09995 Import the old snownews code into git. The old hg repo blew up anyway. :( 2015-07-02 18:27:59 +02:00