1diff --git a/cuneiform_src/Kern/ctb/src/ctb_oper.c b/cuneiform_src/Kern/ctb/src/ctb_oper.c
2index 2aedd58..3d7ec65 100644
3--- a/cuneiform_src/Kern/ctb/src/ctb_oper.c
4+++ b/cuneiform_src/Kern/ctb/src/ctb_oper.c
5@@ -61,6 +61,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6 #define MAXPATH 256
7 #include<string.h>
8 #include<sys/stat.h>
9+#include<ctype.h>
10 #include "ctb.h"
11
12 /// extern fuxntions and data
13diff --git a/cuneiform_src/Kern/dif/src/diffr.c b/cuneiform_src/Kern/dif/src/diffr.c
14index f0d89db..7d0d898 100644
15--- a/cuneiform_src/Kern/dif/src/diffr.c
16+++ b/cuneiform_src/Kern/dif/src/diffr.c
17@@ -105,7 +105,7 @@ extern uchar BUFFER[256]; /*
18 extern uchar LOCAL[50]; /* ���न���� ��� */
19 extern uchar LOCAL_W[50]; /* ��ਭ� ��� */
20 extern uchar end1,beg2; /* ����� 1 � ��砫� 2-�� ��� ��� */
21-extern broken_ii; /* 䫠� ���� ����� */
22+extern uchar broken_ii; /* 䫠� ���� ����� */
23 extern int16_t dnri_hook; // bottom right hook in small russian italic II,III
24 extern int16_t uple_hook; // bottom left hook in small russian italic II,III
25 extern int16_t up_jack ; // upper jack
26diff --git a/cuneiform_src/Kern/hdebug/__snp.c b/cuneiform_src/Kern/hdebug/__snp.c
27index cbf3353..8682cb1 100644
28--- a/cuneiform_src/Kern/hdebug/__snp.c
29+++ b/cuneiform_src/Kern/hdebug/__snp.c
30@@ -986,11 +986,11 @@ extern "C" {
31 void SnpDrawLine(Point16* start, Point16* end, int32_t skew,
32 uint32_t rgb_color, int16_t pen_width, Handle key )
33 {
34- LDPUMA_DrawLine(NULL,start,end,skew,rgb_color,pen_width,key );
35+ LDPUMA_DrawLine(NULL,start,end,skew,rgb_color,pen_width,(long int)key );
36 };
37 void SnpHideLines(Handle key)
38 {
39- LDPUMA_DeleteLines(NULL,key);
40+ LDPUMA_DeleteLines(NULL,(long int)key);
41 };
42 void SnpUpdateViews(void)
43 {
44diff --git a/cuneiform_src/Kern/leo/src/leo_dll.c b/cuneiform_src/Kern/leo/src/leo_dll.c
45index da09092..25bc167 100644
46--- a/cuneiform_src/Kern/leo/src/leo_dll.c
47+++ b/cuneiform_src/Kern/leo/src/leo_dll.c
48@@ -60,6 +60,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49 #include <ctype.h>
50 /*#include <io.h>*/
51
52+#include "cfcompat.h"
53 #include "leo_tune.h"
54 #include "cpu.h"
55 #define PC_TYPE 0
56diff --git a/cuneiform_src/Kern/loc/src/loc.c b/cuneiform_src/Kern/loc/src/loc.c
57index e416b33..4b817ad 100644
58--- a/cuneiform_src/Kern/loc/src/loc.c
59+++ b/cuneiform_src/Kern/loc/src/loc.c
60@@ -63,6 +63,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
61 #include <unistd.h>
62 #endif
63 #include "loc.h"
64+#include "cfcompat.h"
65 #include "struct.h"
66 #include <sys/stat.h>
67
68diff --git a/cuneiform_src/Kern/rbal/src/linbam.c b/cuneiform_src/Kern/rbal/src/linbam.c
69index cd34fab..a0a93d6 100644
70--- a/cuneiform_src/Kern/rbal/src/linbam.c
71+++ b/cuneiform_src/Kern/rbal/src/linbam.c
72@@ -65,7 +65,7 @@
73 #include "lang_def.h" // 08.09.2000 E.P.
74 #include "minmax.h"
75
76-extern line_BL;
77+extern Bool line_BL;
78 extern CSTR_line lin_str;
79
80 static void set_basint(void);
81diff --git a/cuneiform_src/Kern/rblock/sources/c/ltmain.c b/cuneiform_src/Kern/rblock/sources/c/ltmain.c
82index 0653b6b..1c99b28 100644
83--- a/cuneiform_src/Kern/rblock/sources/c/ltmain.c
84+++ b/cuneiform_src/Kern/rblock/sources/c/ltmain.c
85@@ -583,7 +583,7 @@ void PageStrings2 (void)
86
87 void LayoutPart1 (void)
88 {
89-extern SheetsCorrectRoots();
90+// extern SheetsCorrectRoots();
91 # ifdef LT_DEBUG
92 switch (layout)
93 {
94diff --git a/cuneiform_src/Kern/rblock/sources/c/ltroots.c b/cuneiform_src/Kern/rblock/sources/c/ltroots.c
95index e68abd5..7efee82 100644
96--- a/cuneiform_src/Kern/rblock/sources/c/ltroots.c
97+++ b/cuneiform_src/Kern/rblock/sources/c/ltroots.c
98@@ -69,6 +69,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
99
100 # include <fcntl.h>
101 # include <stdio.h>
102+# include <unistd.h>
103 /*# include <crtdbg.h>*/
104 #include <assert.h>
105
106@@ -126,7 +127,7 @@ Bool RootsLoadFile (char * pFilename)
107 return (FALSE);
108 }
109
110- while (read (hFile, &RootRecord, sizeof (ROOT)) == sizeof (ROOT))
111+ while (read ((int)hFile, &RootRecord, sizeof (ROOT)) == sizeof (ROOT))
112 {
113 RootRecord.bReached = FALSE;
114
115@@ -143,14 +144,14 @@ Bool RootsLoadFile (char * pFilename)
116 {
117 ErrorNoEnoughMemory ("in LTROOTS.C,RootsLoadFile,part 1");
118 nRoots = 0;
119- close (hFile);
120+ close ((int)hFile);
121 return (FALSE);
122 }
123
124 pRoots [nRoots - 1] = RootRecord;
125 }
126
127- close (hFile);
128+ close ((int)hFile);
129 return (TRUE);
130 }
131 # endif
132diff --git a/cuneiform_src/Kern/rstr/src/diffr.c b/cuneiform_src/Kern/rstr/src/diffr.c
133index 3427806..c4ad6aa 100644
134--- a/cuneiform_src/Kern/rstr/src/diffr.c
135+++ b/cuneiform_src/Kern/rstr/src/diffr.c
136@@ -168,7 +168,7 @@ extern uchar BUFFER[256]; /*
137 extern uchar LOCAL[50]; /* ���न���� ��� */
138 extern uchar LOCAL_W[50]; /* ��ਭ� ��� */
139 extern uchar end1,beg2; /* ����� 1 � ��砫� 2-�� ��� ��� */
140-extern broken_ii; /* 䫠� ���� ����� */
141+extern uchar broken_ii; /* 䫠� ���� ����� */
142 extern int16_t dnri_hook; // bottom right hook in small russian italic II,III
143 extern int16_t uple_hook; // bottom left hook in small russian italic II,III
144 extern int16_t up_jack ; // upper jack
145diff --git a/cuneiform_src/Kern/rstr/src/match_wd.c b/cuneiform_src/Kern/rstr/src/match_wd.c
146index 7a8c7f5..ca5f933 100644
147--- a/cuneiform_src/Kern/rstr/src/match_wd.c
148+++ b/cuneiform_src/Kern/rstr/src/match_wd.c
149@@ -341,7 +341,7 @@ param.monitors=*((uint32_t*)points);
150 param.p2_active=1; //call while p2 pass
151 param.language=3; // LANG_RUSSIAN
152
153-if((rc=setjmp(Control_Point())) != 0)
154+if((rc=setjmp(*Control_Point())) != 0)
155 return FALSE;
156
157 w=match_string(ln, word, ¶m);
158diff --git a/cuneiform_src/Kern/rstr/src/rcm.c b/cuneiform_src/Kern/rstr/src/rcm.c
159index 0659b69..45cf362 100644
160--- a/cuneiform_src/Kern/rstr/src/rcm.c
161+++ b/cuneiform_src/Kern/rstr/src/rcm.c
162@@ -2648,7 +2648,7 @@ int16_t text_findstat_agressive(char * w) {
163 }
164
165 jmp_buf * Control_Point() {
166- return jumper;
167+ return &jumper;
168 }
169
170 /////////////