aboutsummaryrefslogtreecommitdiffstats
path: root/src/kern-linux.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2015-12-10 22:57:51 +0100
committerMattias Andrée <maandree@member.fsf.org>2015-12-10 22:57:51 +0100
commit6a4cbfccbd649b6e9dd92be74d106f7a8336a264 (patch)
tree4f9f38fe21853c92dc3622db5857d6507613cfd6 /src/kern-linux.c
parentmostly splitting the source (diff)
downloadscrotty-6a4cbfccbd649b6e9dd92be74d106f7a8336a264.tar.gz
scrotty-6a4cbfccbd649b6e9dd92be74d106f7a8336a264.tar.bz2
scrotty-6a4cbfccbd649b6e9dd92be74d106f7a8336a264.tar.xz
soon, convert will not be used
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to '')
-rw-r--r--src/kern-linux.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/kern-linux.c b/src/kern-linux.c
index af17822..28b4d4e 100644
--- a/src/kern-linux.c
+++ b/src/kern-linux.c
@@ -54,7 +54,7 @@ print_not_found_help (void)
* @param fbno The index of the framebuffer.
*/
void
-get_fbpath (char *pathbuf, int altpath, int fbno)
+get_fbpath (char *restrict pathbuf, int altpath, int fbno)
{
sprintf (pathbuf, "%s/fb%s%i", DEVDIR, (altpath ? "/" : ""), fbno);
}
@@ -70,7 +70,7 @@ get_fbpath (char *pathbuf, int altpath, int fbno)
* @return Zero on success, -1 on error.
*/
int
-measure (int fbno, char *fbpath, long *width, long *height)
+measure (int fbno, char *restrict fbpath, long *restrict width, long *restrict height)
{
static char buf[PATH_MAX];
char *delim;
@@ -124,9 +124,10 @@ measure (int fbno, char *fbpath, long *width, long *height)
* @return Zero on success, -1 on error.
*/
int
-convert_fb (FILE *file, char *buf, size_t n, size_t *adjustment)
+convert_fb (FILE *restrict file, const char *restrict buf,
+ size_t n, size_t *restrict adjustment)
{
- uint32_t *pixel;
+ const uint32_t *restrict pixel;
int r, g, b;
size_t off;
@@ -134,7 +135,7 @@ convert_fb (FILE *file, char *buf, size_t n, size_t *adjustment)
{
/* A pixel in the framebuffer is formatted as `%{blue}%{green}%{red}%{x}`
in big-endian binary, or `%{x}%{red}%{green}%{blue}` in little-endian binary. */
- pixel = (uint32_t *)(buf + off);
+ pixel = (const uint32_t *)(buf + off);
r = (*pixel >> 16) & 255;
g = (*pixel >> 8) & 255;
b = (*pixel >> 0) & 255;