aboutsummaryrefslogtreecommitdiffstats
path: root/console
diff options
context:
space:
mode:
Diffstat (limited to 'console')
-rw-r--r--console/fbtv.c28
-rw-r--r--console/ftp.c4
-rw-r--r--console/matrox.c5
-rw-r--r--console/scantv.c2
-rw-r--r--console/showriff.c8
-rw-r--r--console/webcam.c4
6 files changed, 32 insertions, 19 deletions
diff --git a/console/fbtv.c b/console/fbtv.c
index 30007c0..7961358 100644
--- a/console/fbtv.c
+++ b/console/fbtv.c
@@ -187,7 +187,6 @@ static struct KEYTAB keytab[] = {
#define NKEYTAB (sizeof(keytab)/sizeof(struct KEYTAB))
-static char *snapbase;
static char default_title[128] = "???";
static char message[128] = "";
@@ -195,12 +194,23 @@ static char message[128] = "";
/* framebuffer stuff */
static void
-linear_palette(int bit)
+linear_palette(int r, int g, int b)
{
- int i, size = 256 >> (8 - bit);
+ int i, size;
+ size = 256 >> (8 - r);
for (i = 0; i < size; i++)
- red[i] = green[i] = blue[i] = (unsigned short)(65535.0
+ red[i] = (unsigned short)(65535.0
+ * pow(i/(size - 1.0), fbgamma));
+
+ size = 256 >> (8 - g);
+ for (i = 0; i < size; i++)
+ green[i] = (unsigned short)(65535.0
+ * pow(i/(size - 1.0), fbgamma));
+
+ size = 256 >> (8 - b);
+ for (i = 0; i < size; i++)
+ blue[i] = (unsigned short)(65535.0
* pow(i/(size - 1.0), fbgamma));
}
@@ -232,7 +242,7 @@ fb_initcolors(int fd, int gray)
switch (fb_var.bits_per_pixel) {
case 8:
if (gray) {
- linear_palette(8);
+ linear_palette(8,8,8);
x11_native_format = VIDEO_GRAY;
} else {
dither_palette(5,9,5);
@@ -242,7 +252,9 @@ fb_initcolors(int fd, int gray)
case 15:
case 16:
if (fb_fix.visual == FB_VISUAL_DIRECTCOLOR)
- linear_palette(5);
+ linear_palette(fb_var.red.length,
+ fb_var.green.length,
+ fb_var.blue.length);
#if BYTE_ORDER == BIG_ENDIAN
x11_native_format = (fb_var.green.length == 6) ?
VIDEO_RGB16_BE : VIDEO_RGB15_BE;
@@ -253,7 +265,7 @@ fb_initcolors(int fd, int gray)
break;
case 24:
if (fb_fix.visual == FB_VISUAL_DIRECTCOLOR)
- linear_palette(8);
+ linear_palette(8,8,8);
#if BYTE_ORDER == BIG_ENDIAN
x11_native_format = VIDEO_RGB24;
#else
@@ -262,7 +274,7 @@ fb_initcolors(int fd, int gray)
break;
case 32:
if (fb_fix.visual == FB_VISUAL_DIRECTCOLOR)
- linear_palette(8);
+ linear_palette(8,8,8);
#if BYTE_ORDER == BIG_ENDIAN
x11_native_format = VIDEO_RGB32;
#else
diff --git a/console/ftp.c b/console/ftp.c
index b9720da..dd08991 100644
--- a/console/ftp.c
+++ b/console/ftp.c
@@ -186,7 +186,7 @@ ftp_recv(struct ftp_state *s)
s->connected = 0;
}
if (NULL != strstr(p,"Not connected")) {
- if (ftp_connected)
+ if (!ftp_connected(s))
fprintf(stderr,"ftp: lost connection\n");
s->connected = 0;
}
@@ -236,7 +236,7 @@ ftp_connect(struct ftp_state *s, char *host, char *user, char *pass, char *dir)
/* login */
ftp_send(s,3,"user",user,pass);
if (230 != ftp_recv(s)) {
- if (!ftp_connected)
+ if (!ftp_connected(s))
continue;
fprintf(stderr,"ftp: login incorrect\n");
exit(1);
diff --git a/console/matrox.c b/console/matrox.c
index 4e17f1a..e9011a7 100644
--- a/console/matrox.c
+++ b/console/matrox.c
@@ -5,6 +5,7 @@
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
+#include <inttypes.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
@@ -24,7 +25,7 @@ void (*gfx_scaler_on)(int offscreen, int pitch, int width, int height,
void (*gfx_scaler_off)(void);
static unsigned char *bmmio;
-static unsigned long *mmio;
+static uint32_t *mmio;
static void
wrio4(int adr, unsigned long val)
@@ -227,6 +228,6 @@ gfx_init(int fd)
off = (unsigned long)fb_fix.mmio_start -
((unsigned long)fb_fix.mmio_start & ~(PAGE_SIZE-1));
bmmio += off;
- mmio = (unsigned long*)bmmio;
+ mmio = (uint32_t*)bmmio;
return 0;
}
diff --git a/console/scantv.c b/console/scantv.c
index 204b4c6..617eb13 100644
--- a/console/scantv.c
+++ b/console/scantv.c
@@ -16,10 +16,10 @@
#include <pthread.h>
/* xawtv */
-#include "channel.h"
#include "frequencies.h"
#include "grab-ng.h"
#include "commands.h"
+#include "channel.h"
#include "vbi-data.h"
diff --git a/console/showriff.c b/console/showriff.c
index aa9d093..1279425 100644
--- a/console/showriff.c
+++ b/console/showriff.c
@@ -335,9 +335,9 @@ static void dump_jpeg(unsigned char *buf, int len)
static unsigned char*
off_t_to_char(off_t val, int base, int len)
{
- static const char digit[] = "0123456789abcdef";
- static char outbuf[32];
- char *p = outbuf + sizeof(outbuf);
+ static const unsigned char digit[] = "0123456789abcdef";
+ static unsigned char outbuf[32];
+ unsigned char *p = outbuf + sizeof(outbuf);
int i;
*(--p) = 0;
@@ -375,7 +375,7 @@ static boolean ProcessChunk(FILE* f, size_t filepos, size_t filesize,
FOURCC DesiredTag, int RekDepth,
DWORD* chunksize)
{
- char buf[BUFSIZE];
+ unsigned char buf[BUFSIZE];
int buflen;
char tagstr[5]; /* FOURCC of chunk converted to string */
FOURCC chunkid; /* read FOURCC of chunk */
diff --git a/console/webcam.c b/console/webcam.c
index ace70e9..37c836f 100644
--- a/console/webcam.c
+++ b/console/webcam.c
@@ -62,7 +62,7 @@ char *grab_norm = NULL;
/* jpeg stuff */
static int
-write_file(int fd, char *data, int width, int height)
+write_file(int fd, unsigned char *data, int width, int height)
{
struct jpeg_compress_struct cinfo;
struct jpeg_error_mgr jerr;
@@ -415,7 +415,7 @@ add_text(char *image, int width, int height)
{
time_t t;
struct tm *tm;
- unsigned char line[MSG_MAXLEN+1],*ptr;
+ char line[MSG_MAXLEN+1],*ptr;
int i,x,y,f,len;
time(&t);

Privacy Policy