Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
6ade6fe1
Kaydet (Commit)
6ade6fe1
authored
Şub 02, 2011
tarafından
Tor Lillqvist
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Silence compiler warnings
üst
f38b7b2f
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
26 additions
and
25 deletions
+26
-25
_cpp.c
soltools/cpp/_cpp.c
+1
-1
_eval.c
soltools/cpp/_eval.c
+2
-1
_lex.c
soltools/cpp/_lex.c
+1
-1
_macro.c
soltools/cpp/_macro.c
+4
-4
_tokens.c
soltools/cpp/_tokens.c
+11
-11
_unix.c
soltools/cpp/_unix.c
+2
-2
cpp.h
soltools/cpp/cpp.h
+5
-5
No files found.
soltools/cpp/_cpp.c
Dosyayı görüntüle @
6ade6fe1
...
...
@@ -299,7 +299,7 @@ void
}
void
*
domalloc
(
in
t
size
)
domalloc
(
size_
t
size
)
{
void
*
p
=
malloc
(
size
);
...
...
soltools/cpp/_eval.c
Dosyayı görüntüle @
6ade6fe1
...
...
@@ -234,7 +234,8 @@ long
{
Token
*
tp
;
Nlist
*
np
;
int
ntok
,
rnd
;
size_t
ntok
;
int
rnd
;
trp
->
tp
++
;
if
(
kw
==
KIFDEF
||
kw
==
KIFNDEF
)
...
...
soltools/cpp/_lex.c
Dosyayı görüntüle @
6ade6fe1
...
...
@@ -635,7 +635,7 @@ Source *
setsource
(
char
*
name
,
int
path
,
int
fd
,
char
*
str
,
int
wrap
)
{
Source
*
s
=
new
(
Source
);
in
t
len
;
size_
t
len
;
s
->
line
=
1
;
s
->
lineinc
=
0
;
...
...
soltools/cpp/_macro.c
Dosyayı görüntüle @
6ade6fe1
...
...
@@ -516,7 +516,7 @@ void
error
(
ERROR
,
"# not followed by macro parameter"
);
continue
;
}
ntok
=
1
+
(
rtr
->
tp
-
tp
);
ntok
=
1
+
(
int
)(
rtr
->
tp
-
tp
);
rtr
->
tp
=
tp
;
insertrow
(
rtr
,
ntok
,
stringify
(
atr
[
argno
]));
continue
;
...
...
@@ -554,7 +554,7 @@ void
{
Token
*
ltp
,
*
ntp
;
Tokenrow
ntr
;
in
t
len
;
size_
t
len
;
for
(
trp
->
tp
=
trp
->
bp
;
trp
->
tp
<
trp
->
lp
;
trp
->
tp
++
)
{
...
...
@@ -617,7 +617,7 @@ void
doconcat
(
&
ntr
);
trp
->
tp
=
ltp
;
makespace
(
&
ntr
,
ltp
);
insertrow
(
trp
,
ntp
-
ltp
,
&
ntr
);
insertrow
(
trp
,
(
int
)(
ntp
-
ltp
)
,
&
ntr
);
dofree
(
ntr
.
bp
);
trp
->
tp
--
;
}
...
...
@@ -639,7 +639,7 @@ int
for
(
ap
=
mac
->
ap
->
bp
;
ap
<
mac
->
ap
->
lp
;
ap
++
)
{
if
(
ap
->
len
==
tp
->
len
&&
strncmp
((
char
*
)
ap
->
t
,
(
char
*
)
tp
->
t
,
ap
->
len
)
==
0
)
return
ap
-
mac
->
ap
->
bp
;
return
(
int
)(
ap
-
mac
->
ap
->
bp
)
;
}
return
-
1
;
}
...
...
soltools/cpp/_tokens.c
Dosyayı görüntüle @
6ade6fe1
...
...
@@ -194,8 +194,8 @@ void
Token
*
growtokenrow
(
Tokenrow
*
trp
)
{
in
t
ncur
=
trp
->
tp
-
trp
->
bp
;
in
t
nlast
=
trp
->
lp
-
trp
->
bp
;
size_
t
ncur
=
trp
->
tp
-
trp
->
bp
;
size_
t
nlast
=
trp
->
lp
-
trp
->
bp
;
trp
->
max
=
3
*
trp
->
max
/
2
+
1
;
trp
->
bp
=
(
Token
*
)
realloc
(
trp
->
bp
,
trp
->
max
*
sizeof
(
Token
));
...
...
@@ -235,7 +235,7 @@ int
void
insertrow
(
Tokenrow
*
dtr
,
int
ntok
,
Tokenrow
*
str
)
{
int
nrtok
=
rowlen
(
str
);
int
nrtok
=
(
int
)
rowlen
(
str
);
dtr
->
tp
+=
ntok
;
adjustrow
(
dtr
,
nrtok
-
ntok
);
...
...
@@ -274,7 +274,7 @@ void
void
movetokenrow
(
Tokenrow
*
dtr
,
Tokenrow
*
str
)
{
in
t
nby
;
size_
t
nby
;
/* nby = sizeof(Token) * (str->lp - str->bp); */
nby
=
(
char
*
)
str
->
lp
-
(
char
*
)
str
->
bp
;
...
...
@@ -290,7 +290,7 @@ void
void
adjustrow
(
Tokenrow
*
trp
,
int
nt
)
{
in
t
nby
,
size
;
size_
t
nby
,
size
;
if
(
nt
==
0
)
return
;
...
...
@@ -311,7 +311,7 @@ void
Tokenrow
*
copytokenrow
(
Tokenrow
*
dtr
,
Tokenrow
*
str
)
{
int
len
=
rowlen
(
str
);
int
len
=
(
int
)
rowlen
(
str
);
maketokenrow
(
len
,
dtr
);
movetokenrow
(
dtr
,
str
);
...
...
@@ -331,7 +331,7 @@ Tokenrow *
Tokenrow
*
ntrp
=
new
(
Tokenrow
);
int
len
;
len
=
trp
->
lp
-
trp
->
tp
;
len
=
(
int
)(
trp
->
lp
-
trp
->
tp
)
;
if
(
len
<=
0
)
len
=
1
;
maketokenrow
(
len
,
ntrp
);
...
...
@@ -396,7 +396,7 @@ void
{
if
(
tp
->
type
!=
NL
)
{
len
=
tp
->
len
+
tp
->
wslen
;
len
=
(
int
)(
tp
->
len
+
tp
->
wslen
)
;
p
=
tp
->
t
-
tp
->
wslen
;
/* add parameter check to delete operator? */
...
...
@@ -410,7 +410,7 @@ void
if
(
ntp
->
type
==
NAME
)
{
uchar
*
np
=
ntp
->
t
-
ntp
->
wslen
;
int
nlen
=
ntp
->
len
+
ntp
->
wslen
;
int
nlen
=
(
int
)(
ntp
->
len
+
ntp
->
wslen
)
;
memcpy
(
wbp
,
"if("
,
3
);
wbp
+=
4
;
...
...
@@ -492,7 +492,7 @@ void
{
if
(
wbp
>
wbuf
)
{
if
(
write
(
1
,
wbuf
,
wbp
-
wbuf
)
!=
-
1
)
if
(
write
(
1
,
wbuf
,
(
int
)(
wbp
-
wbuf
)
)
!=
-
1
)
wbp
=
wbuf
;
else
exit
(
1
);
...
...
@@ -527,7 +527,7 @@ char *
* Null terminated.
*/
uchar
*
newstring
(
uchar
*
s
,
int
l
,
in
t
o
)
newstring
(
uchar
*
s
,
size_t
l
,
size_
t
o
)
{
uchar
*
ns
=
(
uchar
*
)
domalloc
(
l
+
o
+
1
);
...
...
soltools/cpp/_unix.c
Dosyayı görüntüle @
6ade6fe1
...
...
@@ -135,7 +135,7 @@ void
case
'w'
:
dp
=
&
optarg
[
n
+
1
];
n
+=
strlen
(
dp
);
n
+=
(
int
)
strlen
(
dp
);
while
(
isspace
(
*
dp
))
dp
++
;
for
(
i
=
NINCLUDE
-
1
;
i
>=
0
;
i
--
)
...
...
@@ -173,7 +173,7 @@ void
{
if
((
fp
=
strrchr
(
argv
[
optind
],
'/'
))
!=
NULL
)
{
int
len
=
fp
-
argv
[
optind
]
;
int
len
=
(
int
)(
fp
-
argv
[
optind
])
;
dp
=
(
char
*
)
newstring
((
uchar
*
)
argv
[
optind
],
len
+
1
,
0
);
dp
[
len
]
=
'\0'
;
...
...
soltools/cpp/cpp.h
Dosyayı görüntüle @
6ade6fe1
...
...
@@ -54,8 +54,8 @@ typedef struct token
{
unsigned
char
type
;
unsigned
char
flag
;
unsigned
in
t
wslen
;
unsigned
in
t
len
;
size_
t
wslen
;
size_
t
len
;
uchar
*
t
;
unsigned
int
identifier
;
/* used from macro processor to identify where a macro becomes valid again. */
}
Token
;
...
...
@@ -87,7 +87,7 @@ typedef struct nlist
{
struct
nlist
*
next
;
uchar
*
name
;
in
t
len
;
size_
t
len
;
Tokenrow
*
vp
;
/* value as macro */
Tokenrow
*
ap
;
/* list of argument names, if any */
char
val
;
/* value as preprocessor name */
...
...
@@ -174,7 +174,7 @@ Source *setsource(char *, int, int, char *, int);
void
unsetsource
(
void
);
void
puttokens
(
Tokenrow
*
);
void
process
(
Tokenrow
*
);
void
*
domalloc
(
in
t
);
void
*
domalloc
(
size_
t
);
void
dofree
(
void
*
);
void
error
(
enum
errtype
,
char
*
,...);
void
flushout
(
void
);
...
...
@@ -211,7 +211,7 @@ void setempty(Tokenrow *);
void
makespace
(
Tokenrow
*
,
Token
*
);
char
*
outnum
(
char
*
,
int
);
int
digit
(
int
);
uchar
*
newstring
(
uchar
*
,
int
,
in
t
);
uchar
*
newstring
(
uchar
*
,
size_t
,
size_
t
);
#define rowlen(tokrow) ((tokrow)->lp - (tokrow)->bp)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment