Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.66 KB | None | 0 0
  1. diff -U 3 -H -b -w -B -E -d -t -r -N -- uncrustify/tests/results_cmake/c/02501-custom_types_ssl.c uncrustify/tests/results_run_tests/c/02501-custom_types_ssl.c
  2. --- uncrustify/tests/results_cmake/c/02501-custom_types_ssl.c 1970-01-01 01:00:00.000000000 +0100
  3. +++ uncrustify/tests/results_run_tests/c/02501-custom_types_ssl.c 2016-12-08 14:52:43.936677608 +0100
  4. @@ -0,0 +1,137 @@
  5. +#ifndef HEADER_CONF_H
  6. +#define HEADER_CONF_H
  7. +
  8. +#ifdef __cplusplus
  9. +extern "C" {
  10. +#endif /* ifdef __cplusplus */
  11. +
  12. +typedef struct
  13. +{
  14. + char *section;
  15. + char *name;
  16. + char *value;
  17. +} CONF_VALUE;
  18. +
  19. +DECLARE_STACK_OF(CONF_VALUE);
  20. +DECLARE_LHASH_OF(CONF_VALUE);
  21. +
  22. +struct conf_st;
  23. +struct conf_method_st;
  24. +typedef struct conf_method_st CONF_METHOD;
  25. +
  26. +int CONF_set_default_method(CONF_METHOD *meth);
  27. +void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash);
  28. +LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file,
  29. + long *eline);
  30. +#ifndef OPENSSL_NO_FP_API
  31. +LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp,
  32. + long *eline);
  33. +#endif /* ifndef OPENSSL_NO_FP_API */
  34. +LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp, long *eline);
  35. +STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf,
  36. + const char *section);
  37. +char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group,
  38. + const char *name);
  39. +long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group,
  40. + const char *name);
  41. +void CONF_free(LHASH_OF(CONF_VALUE) *conf);
  42. +int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out);
  43. +int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out);
  44. +
  45. +
  46. +#ifdef __cplusplus
  47. +}
  48. +#endif /* ifdef __cplusplus */
  49. +
  50. +
  51. +void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash)
  52. +{
  53. + if (default_CONF_method == NULL)
  54. + default_CONF_method = NCONF_default();
  55. +
  56. + default_CONF_method->init(conf);
  57. + conf->data = hash;
  58. +}
  59. +
  60. +LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file,
  61. + long *eline)
  62. +{
  63. + LHASH_OF(CONF_VALUE) *ltmp;
  64. + BIO *in = NULL;
  65. +
  66. +#ifdef OPENSSL_SYS_VMS
  67. + in = BIO_new_file(file, "r");
  68. +#else /* ifdef OPENSSL_SYS_VMS */
  69. + in = BIO_new_file(file, "rb");
  70. +#endif /* ifdef OPENSSL_SYS_VMS */
  71. + if (in == NULL)
  72. + {
  73. + CONFerr(CONF_F_CONF_LOAD, ERR_R_SYS_LIB);
  74. + return NULL;
  75. + }
  76. +
  77. + return ltmp;
  78. +}
  79. +
  80. +#ifndef OPENSSL_NO_FP_API
  81. +LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp,
  82. + long *eline)
  83. +{
  84. + BIO *btmp;
  85. + LHASH_OF(CONF_VALUE) *ltmp;
  86. +
  87. + if (!(btmp = BIO_new_fp(fp, BIO_NOCLOSE)))
  88. + {
  89. + CONFerr(CONF_F_CONF_LOAD_FP, ERR_R_BUF_LIB);
  90. + return NULL;
  91. + }
  92. + ltmp = CONF_load_bio(conf, btmp, eline);
  93. + BIO_free(btmp);
  94. + return ltmp;
  95. +}
  96. +
  97. +#endif /* ifndef OPENSSL_NO_FP_API */
  98. +
  99. +LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp,
  100. + long *eline)
  101. +{
  102. + CONF ctmp;
  103. + int ret;
  104. +
  105. + CONF_set_nconf(&ctmp, conf);
  106. +
  107. + ret = NCONF_load_bio(&ctmp, bp, eline);
  108. + if (ret)
  109. + return ctmp.data;
  110. +
  111. + return NULL;
  112. +}
  113. +
  114. +STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf,
  115. + const char *section)
  116. +{
  117. + if (conf == NULL)
  118. + {
  119. + return NULL;
  120. + }
  121. + else
  122. + {
  123. + CONF ctmp;
  124. + CONF_set_nconf(&ctmp, conf);
  125. + return NCONF_get_section(&ctmp, section);
  126. + }
  127. +}
  128. +
  129. +char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group,
  130. + const char *name)
  131. +{
  132. + if (conf == NULL)
  133. + {
  134. + return NCONF_get_string(NULL, group, name);
  135. + }
  136. + else
  137. + {
  138. + return NCONF_get_string(&ctmp, group, name);
  139. + }
  140. +}
  141. +
  142. diff -U 3 -H -b -w -B -E -d -t -r -N -- uncrustify/tests/results_cmake/c/02502-custom_types_ssl.c uncrustify/tests/results_run_tests/c/02502-custom_types_ssl.c
  143. --- uncrustify/tests/results_cmake/c/02502-custom_types_ssl.c 1970-01-01 01:00:00.000000000 +0100
  144. +++ uncrustify/tests/results_run_tests/c/02502-custom_types_ssl.c 2016-12-08 14:52:43.966677609 +0100
  145. @@ -0,0 +1,134 @@
  146. +#ifndef HEADER_CONF_H
  147. +#define HEADER_CONF_H
  148. +
  149. +#ifdef __cplusplus
  150. +extern "C" {
  151. +#endif
  152. +
  153. +typedef struct
  154. +{
  155. + char *section;
  156. + char *name;
  157. + char *value;
  158. +} CONF_VALUE;
  159. +
  160. +DECLARE_STACK_OF( CONF_VALUE );
  161. +DECLARE_LHASH_OF( CONF_VALUE );
  162. +
  163. +struct conf_st;
  164. +struct conf_method_st;
  165. +typedef struct conf_method_st CONF_METHOD;
  166. +
  167. +int CONF_set_default_method ( CONF_METHOD *meth );
  168. +void CONF_set_nconf ( CONF *conf,LHASH_OF(CONF_VALUE) *hash );
  169. +LHASH_OF(CONF_VALUE) *CONF_load ( LHASH_OF(CONF_VALUE) *conf,const char *file,
  170. + long *eline );
  171. +#ifndef OPENSSL_NO_FP_API
  172. +LHASH_OF(CONF_VALUE) *CONF_load_fp ( LHASH_OF(CONF_VALUE) *conf, FILE *fp,
  173. + long *eline );
  174. +#endif
  175. +LHASH_OF(CONF_VALUE) *CONF_load_bio ( LHASH_OF(CONF_VALUE) *conf, BIO *bp,long *eline );
  176. +STACK_OF(CONF_VALUE) *CONF_get_section ( LHASH_OF(CONF_VALUE) *conf,
  177. + const char * section );
  178. +char *CONF_get_string ( LHASH_OF(CONF_VALUE) *conf,const char *group,
  179. + const char *name );
  180. +long CONF_get_number ( LHASH_OF(CONF_VALUE) *conf,const char *group,
  181. + const char *name );
  182. +void CONF_free ( LHASH_OF(CONF_VALUE) *conf );
  183. +int CONF_dump_fp ( LHASH_OF(CONF_VALUE) *conf, FILE *out );
  184. +int CONF_dump_bio ( LHASH_OF(CONF_VALUE) *conf, BIO *out );
  185. +
  186. +
  187. +#ifdef __cplusplus
  188. +}
  189. +#endif
  190. +
  191. +
  192. +void CONF_set_nconf ( CONF *conf, LHASH_OF(CONF_VALUE) *hash )
  193. +{
  194. + if (default_CONF_method == NULL)
  195. + default_CONF_method = NCONF_default();
  196. +
  197. + default_CONF_method->init( conf );
  198. + conf->data = hash;
  199. +}
  200. +
  201. +
  202. +LHASH_OF(CONF_VALUE) *CONF_load ( LHASH_OF(CONF_VALUE) *conf, const char *file,
  203. + long *eline )
  204. +{
  205. + LHASH_OF(CONF_VALUE) *ltmp;
  206. + BIO *in = NULL;
  207. +
  208. +#ifdef OPENSSL_SYS_VMS
  209. + in = BIO_new_file( file, "r" );
  210. +#else
  211. + in = BIO_new_file( file, "rb" );
  212. +#endif
  213. + if (in == NULL)
  214. + {
  215. + CONFerr( CONF_F_CONF_LOAD,ERR_R_SYS_LIB );
  216. + return NULL;
  217. + }
  218. +
  219. + return ltmp;
  220. +}
  221. +
  222. +#ifndef OPENSSL_NO_FP_API
  223. +LHASH_OF(CONF_VALUE) *CONF_load_fp ( LHASH_OF(CONF_VALUE) *conf, FILE *fp,
  224. + long *eline )
  225. +{
  226. + BIO *btmp;
  227. + LHASH_OF(CONF_VALUE) *ltmp;
  228. + if(!(btmp = BIO_new_fp( fp, BIO_NOCLOSE ))) {
  229. + CONFerr( CONF_F_CONF_LOAD_FP,ERR_R_BUF_LIB );
  230. + return NULL;
  231. + }
  232. + ltmp = CONF_load_bio( conf, btmp, eline );
  233. + BIO_free( btmp );
  234. + return ltmp;
  235. +}
  236. +#endif
  237. +
  238. +LHASH_OF(CONF_VALUE) *CONF_load_bio ( LHASH_OF(CONF_VALUE) *conf, BIO *bp,
  239. + long *eline )
  240. +{
  241. + CONF ctmp;
  242. + int ret;
  243. +
  244. + CONF_set_nconf( &ctmp, conf );
  245. +
  246. + ret = NCONF_load_bio( &ctmp, bp, eline );
  247. + if (ret)
  248. + return ctmp.data;
  249. + return NULL;
  250. +}
  251. +
  252. +STACK_OF(CONF_VALUE) *CONF_get_section ( LHASH_OF(CONF_VALUE) *conf,
  253. + const char * section )
  254. +{
  255. + if (conf == NULL)
  256. + {
  257. + return NULL;
  258. + }
  259. + else
  260. + {
  261. + CONF ctmp;
  262. + CONF_set_nconf( &ctmp, conf );
  263. + return NCONF_get_section( &ctmp, section );
  264. + }
  265. +}
  266. +
  267. +char *CONF_get_string ( LHASH_OF(CONF_VALUE) *conf,const char *group,
  268. + const char *name )
  269. +{
  270. + if (conf == NULL)
  271. + {
  272. + return NCONF_get_string( NULL, group, name );
  273. + }
  274. + else
  275. + {
  276. + return NCONF_get_string( &ctmp, group, name );
  277. + }
  278. +}
  279. +
  280. diff -U 3 -H -b -w -B -E -d -t -r -N -- uncrustify/tests/results_cmake/c/02503-pp_concat_asn1.h uncrustify/tests/results_run_tests/c/02503-pp_concat_asn1.h
  281. --- uncrustify/tests/results_cmake/c/02503-pp_concat_asn1.h 1970-01-01 01:00:00.000000000 +0100
  282. +++ uncrustify/tests/results_run_tests/c/02503-pp_concat_asn1.h 2016-12-08 14:52:44.036677612 +0100
  283. @@ -0,0 +1,298 @@
  284. +#ifndef HEADER_ASN1_H
  285. +#define HEADER_ASN1_H
  286. +
  287. +#define V_ASN1_UNIVERSAL 0x00
  288. +#define V_ASN1_APPLICATION 0x40
  289. +#define V_ASN1_CONTEXT_SPECIFIC 0x80
  290. +#define V_ASN1_PRIVATE 0xc0
  291. +
  292. +#define V_ASN1_CONSTRUCTED 0x20
  293. +#define V_ASN1_PRIMITIVE_TAG 0x1f
  294. +#define V_ASN1_PRIMATIVE_TAG 0x1f
  295. +
  296. +#define V_ASN1_APP_CHOOSE -2 /* let the recipient choose */
  297. +#define V_ASN1_OTHER -3 /* used in ASN1_TYPE */
  298. +#define V_ASN1_ANY -4 /* used in ASN1 template code */
  299. +
  300. +#define V_ASN1_NEG 0x100 /* negative flag */
  301. +
  302. +#define V_ASN1_UNDEF -1
  303. +#define V_ASN1_EOC 0
  304. +#define V_ASN1_BOOLEAN 1 /**/
  305. +#define V_ASN1_INTEGER 2
  306. +#define V_ASN1_NEG_INTEGER (2 | V_ASN1_NEG)
  307. +#define V_ASN1_BIT_STRING 3
  308. +#define V_ASN1_OCTET_STRING 4
  309. +#define V_ASN1_NULL 5
  310. +#define V_ASN1_OBJECT 6 /* object identifier */
  311. +#define V_ASN1_OBJECT_DESCRIPTOR 7
  312. +#define V_ASN1_EXTERNAL 8 /* external / instance of */
  313. +#define V_ASN1_REAL 9
  314. +#define V_ASN1_ENUMERATED 10
  315. +#define V_ASN1_NEG_ENUMERATED (10 | V_ASN1_NEG)
  316. +#define V_ASN1_EMBEDDED_PDV 11
  317. +#define V_ASN1_UTF8STRING 12
  318. +#define V_ASN1_SEQUENCE 16
  319. +#define V_ASN1_SET 17
  320. +#define V_ASN1_NUMERICSTRING 18 /**/
  321. +#define V_ASN1_PRINTABLESTRING 19
  322. +#define V_ASN1_T61STRING 20
  323. +#define V_ASN1_TELETEXSTRING 20 /* alias */
  324. +#define V_ASN1_VIDEOTEXSTRING 21 /**/
  325. +#define V_ASN1_IA5STRING 22
  326. +#define V_ASN1_UTCTIME 23
  327. +#define V_ASN1_GENERALIZEDTIME 24 /**/
  328. +#define V_ASN1_GRAPHICSTRING 25 /**/
  329. +#define V_ASN1_ISO64STRING 26 /**/
  330. +#define V_ASN1_VISIBLESTRING 26 /* alias */
  331. +#define V_ASN1_GENERALSTRING 27 /**/
  332. +#define V_ASN1_UNIVERSALSTRING 28 /**/
  333. +#define V_ASN1_BMPSTRING 30
  334. +
  335. +/* For use with d2i_ASN1_type_bytes() */
  336. +#define B_ASN1_NUMERICSTRING 0x0001
  337. +#define B_ASN1_PRINTABLESTRING 0x0002
  338. +#define B_ASN1_T61STRING 0x0004
  339. +#define B_ASN1_TELETEXSTRING 0x0004
  340. +#define B_ASN1_VIDEOTEXSTRING 0x0008
  341. +#define B_ASN1_IA5STRING 0x0010
  342. +#define B_ASN1_GRAPHICSTRING 0x0020
  343. +#define B_ASN1_ISO64STRING 0x0040
  344. +#define B_ASN1_VISIBLESTRING 0x0040
  345. +#define B_ASN1_GENERALSTRING 0x0080
  346. +#define B_ASN1_UNIVERSALSTRING 0x0100
  347. +#define B_ASN1_OCTET_STRING 0x0200
  348. +#define B_ASN1_BIT_STRING 0x0400
  349. +#define B_ASN1_BMPSTRING 0x0800
  350. +#define B_ASN1_UNKNOWN 0x1000
  351. +#define B_ASN1_UTF8STRING 0x2000
  352. +#define B_ASN1_UTCTIME 0x4000
  353. +#define B_ASN1_GENERALIZEDTIME 0x8000
  354. +#define B_ASN1_SEQUENCE 0x10000
  355. +
  356. +/* For use with ASN1_mbstring_copy() */
  357. +#define MBSTRING_FLAG 0x1000
  358. +#define MBSTRING_UTF8 (MBSTRING_FLAG)
  359. +#define MBSTRING_ASC (MBSTRING_FLAG | 1)
  360. +#define MBSTRING_BMP (MBSTRING_FLAG | 2)
  361. +#define MBSTRING_UNIV (MBSTRING_FLAG | 4)
  362. +
  363. +#define SMIME_OLDMIME 0x400
  364. +#define SMIME_CRLFEOL 0x800
  365. +#define SMIME_STREAM 0x1000
  366. +
  367. +struct X509_algor_st;
  368. +DECLARE_STACK_OF(X509_ALGOR);
  369. +
  370. +#define DECLARE_ASN1_SET_OF(type) /* filled in by mkstack.pl */
  371. +#define IMPLEMENT_ASN1_SET_OF(type) /* nothing, no longer needed */
  372. +
  373. +/* We MUST make sure that, except for constness, asn1_ctx_st and
  374. + * asn1_const_ctx are exactly the same. Fortunately, as soon as
  375. + * the old ASN1 parsing macros are gone, we can throw this away
  376. + * as well... */
  377. +typedef struct asn1_ctx_st
  378. +{
  379. + unsigned char *p; /* work char pointer */
  380. + int eos; /* end of sequence read for indefinite encoding */
  381. + int error; /* error code to use when returning an error */
  382. + int inf; /* constructed if 0x20, indefinite is 0x21 */
  383. + int tag; /* tag from last 'get object' */
  384. + int xclass; /* class from last 'get object' */
  385. + size_t slen; /* length of last 'get object' */
  386. + unsigned char * max; /* largest value of p allowed */
  387. + unsigned char * q; /* temporary variable */
  388. + unsigned char **pp; /* variable */
  389. + int line; /* used in error processing */
  390. +} ASN1_CTX;
  391. +
  392. +typedef struct asn1_const_ctx_st
  393. +{
  394. + const unsigned char *p; /* work char pointer */
  395. + int eos; /* end of sequence read for indefinite encoding */
  396. + int error; /* error code to use when returning an error */
  397. + int inf; /* constructed if 0x20, indefinite is 0x21 */
  398. + int tag; /* tag from last 'get object' */
  399. + int xclass; /* class from last 'get object' */
  400. + size_t slen; /* length of last 'get object' */
  401. + const unsigned char * max; /* largest value of p allowed */
  402. + const unsigned char * q; /* temporary variable */
  403. + const unsigned char **pp; /* variable */
  404. + int line; /* used in error processing */
  405. +} ASN1_const_CTX;
  406. +
  407. +/* These are used internally in the ASN1_OBJECT to keep track of
  408. + * whether the names and data need to be free()ed */
  409. +#define ASN1_OBJECT_FLAG_DYNAMIC 0x01 /* internal use */
  410. +#define ASN1_OBJECT_FLAG_CRITICAL 0x02 /* critical x509v3 object id */
  411. +#define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04 /* internal use */
  412. +#define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08 /* internal use */
  413. +typedef struct asn1_object_st
  414. +{
  415. + const char *sn, *ln;
  416. + int nid;
  417. + size_t length;
  418. + const unsigned char *data; /* data remains const after init */
  419. + int flags; /* Should we free this one */
  420. +} ASN1_OBJECT;
  421. +
  422. +#define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */
  423. +/* This indicates that the ASN1_STRING is not a real value but just a place
  424. + * holder for the location where indefinite length constructed data should
  425. + * be inserted in the memory buffer
  426. + */
  427. +#define ASN1_STRING_FLAG_NDEF 0x010
  428. +
  429. +/* This flag is used by the CMS code to indicate that a string is not
  430. + * complete and is a place holder for content when it had all been
  431. + * accessed. The flag will be reset when content has been written to it.
  432. + */
  433. +
  434. +#define ASN1_STRING_FLAG_CONT 0x020
  435. +
  436. +/* This is the base type that holds just about everything :-) */
  437. +typedef struct asn1_string_st
  438. +{
  439. + size_t length;
  440. + int type;
  441. + unsigned char *data;
  442. +
  443. + /* The value of the following field depends on the type being
  444. + * held. It is mostly being used for BIT_STRING so if the
  445. + * input data has a non-zero 'unused bits' value, it will be
  446. + * handled correctly */
  447. + long flags;
  448. +} ASN1_STRING;
  449. +
  450. +/* ASN1_ENCODING structure: this is used to save the received
  451. + * encoding of an ASN1 type. This is useful to get round
  452. + * problems with invalid encodings which can break signatures.
  453. + */
  454. +
  455. +typedef struct ASN1_ENCODING_st
  456. +{
  457. + unsigned char *enc; /* DER encoding */
  458. + size_t len; /* Length of encoding */
  459. + int modified; /* set to 1 if 'enc' is invalid */
  460. +} ASN1_ENCODING;
  461. +
  462. +/* Used with ASN1 LONG type: if a long is set to this it is omitted */
  463. +#define ASN1_LONG_UNDEF 0x7fffffffL
  464. +
  465. +#define STABLE_FLAGS_MALLOC 0x01
  466. +#define STABLE_NO_MASK 0x02
  467. +#define DIRSTRING_TYPE \
  468. + (B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_BMPSTRING | B_ASN1_UTF8STRING)
  469. +#define PKCS9STRING_TYPE (DIRSTRING_TYPE | B_ASN1_IA5STRING)
  470. +
  471. +/* Declarations for template structures: for full definitions
  472. + * see asn1t.h
  473. + */
  474. +typedef struct ASN1_TEMPLATE_st ASN1_TEMPLATE;
  475. +typedef struct ASN1_ITEM_st ASN1_ITEM;
  476. +typedef struct ASN1_TLC_st ASN1_TLC;
  477. +/* This is just an opaque pointer */
  478. +typedef struct ASN1_VALUE_st ASN1_VALUE;
  479. +
  480. +/* Declare ASN1 functions: the implement macro in in asn1t.h */
  481. +
  482. +#define DECLARE_ASN1_FUNCTIONS(type) DECLARE_ASN1_FUNCTIONS_name(type, type)
  483. +
  484. +#define DECLARE_ASN1_ALLOC_FUNCTIONS(type) \
  485. + DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, type)
  486. +
  487. +#define DECLARE_ASN1_FUNCTIONS_name(type, name) \
  488. + DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name); \
  489. + DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name)
  490. +
  491. +#define DECLARE_ASN1_FUNCTIONS_fname(type, itname, name) \
  492. + DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name); \
  493. + DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name)
  494. +
  495. +#define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \
  496. + type *d2i_##name(type **a, const unsigned char **in, size_t len); \
  497. + int i2d_##name(const type *a, unsigned char **out); \
  498. + DECLARE_ASN1_ITEM(itname)
  499. +
  500. +#define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \
  501. + type *d2i_##name(type **a, const unsigned char **in, size_t len); \
  502. + int i2d_##name(const type *a, unsigned char **out); \
  503. + DECLARE_ASN1_ITEM(name)
  504. +
  505. +#define DECLARE_ASN1_NDEF_FUNCTION(name) \
  506. + int i2d_##name##_NDEF(const name * a, unsigned char **out)
  507. +
  508. +#define DECLARE_ASN1_FUNCTIONS_const(name) \
  509. + DECLARE_ASN1_ALLOC_FUNCTIONS(name); \
  510. + DECLARE_ASN1_ENCODE_FUNCTIONS_const(name, name)
  511. +
  512. +#define DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
  513. + type *name##_new(void); \
  514. + void name##_free(type *a)
  515. +
  516. +#define DECLARE_ASN1_PRINT_FUNCTION(stname) \
  517. + DECLARE_ASN1_PRINT_FUNCTION_fname(stname, stname)
  518. +
  519. +#define DECLARE_ASN1_PRINT_FUNCTION_fname(stname, fname) \
  520. + int fname##_print_ctx(BIO *out, const stname *x, int indent, \
  521. + const ASN1_PCTX * pctx)
  522. +
  523. +
  524. +/*
  525. + * WARNING WARNING WARNING
  526. + *
  527. + * uncrustify still introduces whitespace in here at some spots, but then
  528. + * one might ask how crazy we want to go regarding ## encumbered parsing?
  529. + * There's always the copout of INDENT-OFF markers for files like these,
  530. + * once you've got them 95% right through uncrustify and that extra 5%
  531. + * by hand ;-)
  532. + */
  533. +#define TYPEDEF_D2I_OF(type) typedef type *d2i_of_##type (type **, const unsigned char **, size_t)
  534. +#define TYPEDEF_I2D_OF(type) typedef int i2d_of_##type (type *, unsigned char **)
  535. +#define TYPEDEF_I2D_OF_CONST(type) typedef int i2d_of_const_##type (const type *, unsigned char **) /* [i_a] */
  536. +#define TYPEDEF_D2I2D_OF(type) TYPEDEF_D2I_OF(type); TYPEDEF_I2D_OF(type); TYPEDEF_I2D_OF_CONST(type) /* [i_a] */
  537. +
  538. +
  539. +/* Macro to include ASN1_ITEM pointer from base type */
  540. +#define ASN1_ITEM_ref(iptr) (&(iptr##_it))
  541. +
  542. +#define ASN1_ITEM_rptr(ref) (&(ref##_it))
  543. +
  544. +#define DECLARE_ASN1_ITEM(name) \
  545. + extern const ASN1_ITEM name##_it;
  546. +
  547. +
  548. +#define ASN1_STRFLGS_RFC2253 \
  549. + (ASN1_STRFLGS_ESC_2253 | \
  550. + ASN1_STRFLGS_ESC_CTRL | \
  551. + ASN1_STRFLGS_ESC_MSB | \
  552. + ASN1_STRFLGS_UTF8_CONVERT | \
  553. + ASN1_STRFLGS_DUMP_UNKNOWN | \
  554. + ASN1_STRFLGS_DUMP_DER)
  555. +
  556. +DECLARE_STACK_OF(ASN1_INTEGER);
  557. +DECLARE_ASN1_SET_OF(ASN1_INTEGER);
  558. +
  559. +DECLARE_STACK_OF(ASN1_GENERALSTRING);
  560. +
  561. +typedef STACK_OF(ASN1_TYPE) ASN1_SEQUENCE_ANY;
  562. +
  563. +DECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SEQUENCE_ANY);
  564. +DECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SET_ANY);
  565. +
  566. +
  567. +#define B_ASN1_DIRECTORYSTRING \
  568. + B_ASN1_PRINTABLESTRING | \
  569. + B_ASN1_TELETEXSTRING | \
  570. + B_ASN1_BMPSTRING | \
  571. + B_ASN1_UNIVERSALSTRING | \
  572. + B_ASN1_UTF8STRING
  573. +
  574. +#define B_ASN1_DISPLAYTEXT \
  575. + B_ASN1_IA5STRING | \
  576. + B_ASN1_VISIBLESTRING | \
  577. + B_ASN1_BMPSTRING | \
  578. + B_ASN1_UTF8STRING
  579. +
  580. +#endif // ifndef HEADER_ASN1_H
  581. +
  582. diff -U 3 -H -b -w -B -E -d -t -r -N -- uncrustify/tests/results_cmake/oc/50001-Fraction.h uncrustify/tests/results_run_tests/oc/50001-Fraction.h
  583. --- uncrustify/tests/results_cmake/oc/50001-Fraction.h 1970-01-01 01:00:00.000000000 +0100
  584. +++ uncrustify/tests/results_run_tests/oc/50001-Fraction.h 2016-12-08 14:52:51.066677916 +0100
  585. @@ -0,0 +1,15 @@
  586. +#import <Foundation/NSObject.h>
  587. +
  588. +@interface Fraction : NSObject
  589. +{
  590. + int numerator;
  591. + int denominator;
  592. +}
  593. +
  594. +-(void) print;
  595. +-(void) setNumerator: (int) d;
  596. +-(void) setDenominator: (int) d;
  597. +-(int) numerator;
  598. +-(int) denominator;
  599. +-(void) setNumDen: (int) n: (int) d;
  600. +@end
  601. diff -U 3 -H -b -w -B -E -d -t -r -N -- uncrustify/tests/results_cmake/oc/50002-Fraction.m uncrustify/tests/results_run_tests/oc/50002-Fraction.m
  602. --- uncrustify/tests/results_cmake/oc/50002-Fraction.m 1970-01-01 01:00:00.000000000 +0100
  603. +++ uncrustify/tests/results_run_tests/oc/50002-Fraction.m 2016-12-08 14:52:51.090011250 +0100
  604. @@ -0,0 +1,29 @@
  605. +#import "Fraction.h"
  606. +#import <stdio.h>
  607. +
  608. +@implementation Fraction
  609. +-(void) print
  610. +{
  611. + printf("%i/%i", numerator, denominator);
  612. +}
  613. +
  614. +-(void) setNumerator: (int) n
  615. +{
  616. + numerator = n;
  617. +}
  618. +
  619. +-(void) setDenominator: (int) d
  620. +{
  621. + denominator = d;
  622. +}
  623. +
  624. +-(int) denominator
  625. +{
  626. + return denominator;
  627. +}
  628. +
  629. +-(int) numerator
  630. +{
  631. + return numerator;
  632. +}
  633. +@end
  634. diff -U 3 -H -b -w -B -E -d -t -r -N -- uncrustify/tests/results_cmake/oc/50005-Declarations.h uncrustify/tests/results_run_tests/oc/50005-Declarations.h
  635. --- uncrustify/tests/results_cmake/oc/50005-Declarations.h 1970-01-01 01:00:00.000000000 +0100
  636. +++ uncrustify/tests/results_run_tests/oc/50005-Declarations.h 2016-12-08 14:52:51.163344587 +0100
  637. @@ -0,0 +1,24 @@
  638. +
  639. +@interface EmptyClass : NSObject
  640. +-(void)aMessage: (id) arg;
  641. +@end
  642. +
  643. +@interface EmptyClass : NSObject
  644. +{
  645. +}
  646. +-(void)aMessage: (id) arg;
  647. +@end
  648. +
  649. +@interface NSObject (ObjectAdditions)
  650. +-(void)aMessage: (id) arg;
  651. +@end
  652. +
  653. +@protocol TestProtocol
  654. +-(void)aMessage: (id) arg;
  655. +@end
  656. +
  657. +@interface TestClass : NSObject<TestProtocol>
  658. +{
  659. +}
  660. +-(void)aMessage: (id) arg;
  661. +@end
  662. diff -U 3 -H -b -w -B -E -d -t -r -N -- uncrustify/tests/results_cmake/oc/50410-oc_cond_colon.m uncrustify/tests/results_run_tests/oc/50410-oc_cond_colon.m
  663. --- uncrustify/tests/results_cmake/oc/50410-oc_cond_colon.m 1970-01-01 01:00:00.000000000 +0100
  664. +++ uncrustify/tests/results_run_tests/oc/50410-oc_cond_colon.m 2016-12-08 14:52:52.490011310 +0100
  665. @@ -0,0 +1,9 @@
  666. +[self.vendorID_TextField setStringValue : string ? string:@""];
  667. +
  668. +x = [NSString str : path];
  669. +x = [NSString strFormat : @"Data/%s", path];
  670. +x = path[0] == '/' ? path:"abc";
  671. +x = path[0] == '/' ? [NSString str : path]:[NSString strFormat : @"Data/%s", path];
  672. +
  673. +id<MTLBuffer> buf = data ? [metal::g_Device newBufferWithBytes : data length : len options : MTLResourceOptionCPUCacheModeDefault]
  674. + :[metal::g_Device newBufferWithLength : len options : MTLResourceOptionCPUCacheModeDefault];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement