V
v0id
Нашел старые исходники GSM..... 1994г.
Visual Studio при первой проверке ругался, а Keil ARM C compiler вроде их съел(собственно это важнее на много сейчас).
Но мне интересено всё-же разобраться, с вашей помощью.
Итак имеем кучу функций типа(обратите внимание на само объявление!):
[codebox]static void Postprocessing P2((S,s),
struct gsm_state * S,
register word * s)
{
register int k;
register word msr = S->msr;
register longword ltmp; /* for GSM_ADD */
register word tmp;
for (k = 160; k--; s++) {
tmp = GSM_MULT_R( msr, 28180 );
msr = GSM_ADD(*s, tmp); /* Deemphasis */
*s = GSM_ADD(msr, msr) & 0xFFF8; /* Truncation & Upscaling */
}
S->msr = msr;
}
[/codebox]
и хидер proto.h
[codebox]#ifndef PROTO_H
#define PROTO_H
#if __cplusplus
# define NeedFunctionPrototypes 1
#endif
#if __STDC__
# define NeedFunctionPrototypes 1
#endif
#ifdef _NO_PROTO
# undef NeedFunctionPrototypes
#endif
#undef P /* gnu stdio.h actually defines this... */
#undef P0
#undef P1
#undef P2
#undef P3
#undef P4
#undef P5
#undef P6
#undef P7
#undef P8
#if NeedFunctionPrototypes
# define P( protos ) protos
# define P0() (void)
# define P1(x, a) (a)
# define P2(x, a,
(a, B)
# define P3(x, a, b, c) (a, b, c)
# define P4(x, a, b, c, d) (a, b, c, d)
# define P5(x, a, b, c, d, e) (a, b, c, d, e)
# define P6(x, a, b, c, d, e, f) (a, b, c, d, e, f)
# define P7(x, a, b, c, d, e, f, g) (a, b, c, d, e, f, g)
# define P8(x, a, b, c, d, e, f, g, h) (a, b, c, d, e, f, g, h)
#else /* !NeedFunctionPrototypes */
# define P( protos ) ( /* protos */ )
# define P0() ()
# define P1(x, a) x a;
# define P2(x, a, B) x a; b;
# define P3(x, a, b, c) x a; b; c;
# define P4(x, a, b, c, d) x a; b; c; d;
# define P5(x, a, b, c, d, e) x a; b; c; d; e;
# define P6(x, a, b, c, d, e, f) x a; b; c; d; e; f;
# define P7(x, a, b, c, d, e, f, g) x a; b; c; d; e; f; g;
# define P8(x, a, b, c, d, e, f, g, h) x a; b; c; d; e; f; g; h;
#endif /* !NeedFunctionPrototypes */
#endif /* PROTO_H */[/codebox]
Где все эти P0 P1 P2 .... прописываются.
Вопрос что это??? Почему так наворочено и синтаксис уловить сразу не получается(ну лично у меня).
В инете поискал - особо ничего не нашел. Знать бы как эта языковая конструкция называется хотя-бы.
И почему ультра-современный MS Visual C 2005 не берёт уже такой код(хотя да, ответ кроется в самом вопросе ;-) )
В общем хэлпните мне если сможете. Заранее спасибо всем.
Visual Studio при первой проверке ругался, а Keil ARM C compiler вроде их съел(собственно это важнее на много сейчас).
Но мне интересено всё-же разобраться, с вашей помощью.
Итак имеем кучу функций типа(обратите внимание на само объявление!):
[codebox]static void Postprocessing P2((S,s),
struct gsm_state * S,
register word * s)
{
register int k;
register word msr = S->msr;
register longword ltmp; /* for GSM_ADD */
register word tmp;
for (k = 160; k--; s++) {
tmp = GSM_MULT_R( msr, 28180 );
msr = GSM_ADD(*s, tmp); /* Deemphasis */
*s = GSM_ADD(msr, msr) & 0xFFF8; /* Truncation & Upscaling */
}
S->msr = msr;
}
[/codebox]
и хидер proto.h
[codebox]#ifndef PROTO_H
#define PROTO_H
#if __cplusplus
# define NeedFunctionPrototypes 1
#endif
#if __STDC__
# define NeedFunctionPrototypes 1
#endif
#ifdef _NO_PROTO
# undef NeedFunctionPrototypes
#endif
#undef P /* gnu stdio.h actually defines this... */
#undef P0
#undef P1
#undef P2
#undef P3
#undef P4
#undef P5
#undef P6
#undef P7
#undef P8
#if NeedFunctionPrototypes
# define P( protos ) protos
# define P0() (void)
# define P1(x, a) (a)
# define P2(x, a,
![Smile :) :)](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f642.png)
# define P3(x, a, b, c) (a, b, c)
# define P4(x, a, b, c, d) (a, b, c, d)
# define P5(x, a, b, c, d, e) (a, b, c, d, e)
# define P6(x, a, b, c, d, e, f) (a, b, c, d, e, f)
# define P7(x, a, b, c, d, e, f, g) (a, b, c, d, e, f, g)
# define P8(x, a, b, c, d, e, f, g, h) (a, b, c, d, e, f, g, h)
#else /* !NeedFunctionPrototypes */
# define P( protos ) ( /* protos */ )
# define P0() ()
# define P1(x, a) x a;
# define P2(x, a, B) x a; b;
# define P3(x, a, b, c) x a; b; c;
# define P4(x, a, b, c, d) x a; b; c; d;
# define P5(x, a, b, c, d, e) x a; b; c; d; e;
# define P6(x, a, b, c, d, e, f) x a; b; c; d; e; f;
# define P7(x, a, b, c, d, e, f, g) x a; b; c; d; e; f; g;
# define P8(x, a, b, c, d, e, f, g, h) x a; b; c; d; e; f; g; h;
#endif /* !NeedFunctionPrototypes */
#endif /* PROTO_H */[/codebox]
Где все эти P0 P1 P2 .... прописываются.
Вопрос что это??? Почему так наворочено и синтаксис уловить сразу не получается(ну лично у меня).
В инете поискал - особо ничего не нашел. Знать бы как эта языковая конструкция называется хотя-бы.
И почему ультра-современный MS Visual C 2005 не берёт уже такой код(хотя да, ответ кроется в самом вопросе ;-) )
В общем хэлпните мне если сможете. Заранее спасибо всем.