summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2019-09-30 18:19:42 +0100
committerFreeArtMan <dos21h@gmail.com>2019-09-30 18:19:42 +0100
commit8a8e0941dd2ab5f089662362a30c91e16de18ce0 (patch)
tree567835cfd70a4632be6f8fd7d31e55641111b677
parent1466036b3e0771e73501bcf573d9e8efc6f62e37 (diff)
downloadihe-8a8e0941dd2ab5f089662362a30c91e16de18ce0.tar.gz
ihe-8a8e0941dd2ab5f089662362a30c91e16de18ce0.zip
Update to compile on other boxes
-rw-r--r--Makefile3
-rw-r--r--cmd/cmd_pagedown.c12
-rw-r--r--cmd/cmd_pageup.c12
-rw-r--r--ihe.c4
-rw-r--r--libbuf/buf.h4
5 files changed, 18 insertions, 17 deletions
diff --git a/Makefile b/Makefile
index fa76dcd..5f6e0f0 100644
--- a/Makefile
+++ b/Makefile
@@ -10,9 +10,8 @@ LIB_OBJECTS=libcmd/libcmd.o libterm/libterm.o h64e/core.o libbuf/libbuf.o
all: clean $(OBJECTS) $(PROJECT)
$(PROJECT):
- $(CPP) -c $(PROJECT).c
+ $(CPP) $(CFALGS) -c $(PROJECT).c
ld -r $(OBJECTS) $(PROJECT).o -o $(PROJECT)_.o
-
$(CPP) $(CFLAGS) $(PROJECT)_.o $(LIB_OBJECTS) -o $(PROJECT)
%.o: %.c
diff --git a/cmd/cmd_pagedown.c b/cmd/cmd_pagedown.c
index 8c4e3c4..6b3af7f 100644
--- a/cmd/cmd_pagedown.c
+++ b/cmd/cmd_pagedown.c
@@ -20,14 +20,14 @@ int c_pagedown( cmd_arg_t *arg )
int ret=-1;
int i,j;
- printf("Set file position\n");
+ //printf("Set file position\n");
//move position
int pos = file_pos(g_file);
- printf("pos %d\n",pos);
- printf("buf size %d\n",g_buf->size());
+ //printf("pos %d\n",pos);
+ //printf("buf size %d\n",g_buf->size());
pos += g_buf->size();
- printf("pos %d\n",pos);
+ //printf("pos %d\n",pos);
file_seekp(g_file, pos);
//read from file
@@ -37,7 +37,7 @@ int c_pagedown( cmd_arg_t *arg )
g_buf->realloc(g_file->blk_size);
}
- printf("read file\n");
+ //printf("read file\n");
char *buf_ptr;
int sz;
@@ -45,7 +45,7 @@ int c_pagedown( cmd_arg_t *arg )
sz = g_buf->size();
//printf("sz %d ptr %lx",sz,buf_ptr);
ret = file_read_blk( g_file, (uint8_t *)buf_ptr, sz );
- printf("Readed %d bytes\n", ret);
+ //printf("Readed %d bytes\n", ret);
if ( (ret >= 0) && (ret <= g_buf->size()) )
{
g_buf->set_size(ret);
diff --git a/cmd/cmd_pageup.c b/cmd/cmd_pageup.c
index 4e0612b..9ee3050 100644
--- a/cmd/cmd_pageup.c
+++ b/cmd/cmd_pageup.c
@@ -20,14 +20,14 @@ int c_pageup( cmd_arg_t *arg )
int ret=-1;
int i,j;
- printf("Set file position\n");
+ //printf("Set file position\n");
//move position
int pos = file_pos(g_file);
- printf("pos %d\n",pos);
- printf("buf size %d\n",g_buf->size());
+ //printf("pos %d\n",pos);
+ //printf("buf size %d\n",g_buf->size());
pos -= g_buf->size();
- printf("pos %d\n",pos);
+ //printf("pos %d\n",pos);
file_seekp(g_file, pos);
//read from file
@@ -37,7 +37,7 @@ int c_pageup( cmd_arg_t *arg )
g_buf->realloc(g_file->blk_size);
}
- printf("read file\n");
+ //printf("read file\n");
char *buf_ptr;
int sz;
@@ -45,7 +45,7 @@ int c_pageup( cmd_arg_t *arg )
sz = g_buf->size();
//printf("sz %d ptr %lx",sz,buf_ptr);
ret = file_read_blk( g_file, (uint8_t *)buf_ptr, sz );
- printf("Readed %d bytes\n", ret);
+ //printf("Readed %d bytes\n", ret);
if ( (ret >= 0) && (ret <= g_buf->size()) )
{
g_buf->set_size(ret);
diff --git a/ihe.c b/ihe.c
index ec6af1c..a257c3a 100644
--- a/ihe.c
+++ b/ihe.c
@@ -617,6 +617,7 @@ int main( int argc, char **argv )
{
char local_cmd[] = "pagedown";
+ write(1,"\n",1);
cmd_buf_clean(&cmd_in);
cmd_buf_add(&cmd_in, local_cmd, strlen(local_cmd));
err = cmd_mng_exec( &cmd_mng, cmd_in.buf, cmd_in.cur_sz );
@@ -633,8 +634,9 @@ int main( int argc, char **argv )
//pageup
if (CMK_KEYMAP4(0x7e,0x35,0x5b,0x1b))
{
- char local_cmd[] = "pageup";
+ char local_cmd[] = "pageup\n";
+ write(1,"\n",1);
cmd_buf_clean(&cmd_in);
cmd_buf_add(&cmd_in, local_cmd, strlen(local_cmd));
err = cmd_mng_exec( &cmd_mng, cmd_in.buf, cmd_in.cur_sz );
diff --git a/libbuf/buf.h b/libbuf/buf.h
index ba5c7e7..dcdbb4c 100644
--- a/libbuf/buf.h
+++ b/libbuf/buf.h
@@ -1,8 +1,8 @@
#ifndef __BUF_H
#define __BUF_H
-#include <stdlib.h>
-#include <stdio.h>
+#include <cstdlib>
+#include <cstdio>
#include <string.h>
#include <ctype.h>
#include <unistd.h>