Warning, /graphics/okular/core/synctex/patches/13-fix-Wundef-warnings.diff is written in an unsupported language. File is not indexed.

0001 Fix compiler warnings for -Wundef
0002 Author: Henrik Fehlauer <rkflx@lab12.net>
0003 
0004 Index: synctex/synctex_parser.c
0005 ===================================================================
0006 --- synctex.orig/synctex_parser.c
0007 +++ synctex/synctex_parser.c
0008 @@ -362,7 +362,7 @@ __synctex_scanner_register_handle_to(NOD
0009  #       pragma mark Tree SETGET
0010  #   endif
0011  
0012 -#if SYNCTEX_DEBUG > 1000
0013 +#if defined SYNCTEX_DEBUG && SYNCTEX_DEBUG > 1000
0014  #define SYNCTEX_PARAMETER_ASSERT(WHAT) \
0015      do { \
0016          if (!(WHAT)) { \
0017 @@ -459,11 +459,11 @@ DEFINE_SYNCTEX_TREE_GETSET(next_hbox)
0018  DEFINE_SYNCTEX_TREE_GETSET(arg_sibling)
0019  DEFINE_SYNCTEX_TREE_GETSET(target)
0020  
0021 -#if SYNCTEX_DEBUG>1000
0022 +#if defined SYNCTEX_DEBUG && SYNCTEX_DEBUG>1000
0023  #   undef SYNCTEX_USE_NODE_COUNT
0024  #   define SYNCTEX_USE_NODE_COUNT 1
0025  #endif
0026 -#if SYNCTEX_USE_NODE_COUNT>0
0027 +#if defined SYNCTEX_USE_NODE_COUNT && SYNCTEX_USE_NODE_COUNT>0
0028  #   define SYNCTEX_DECLARE_NODE_COUNT int node_count;
0029  #   define SYNCTEX_INIT_NODE_COUNT \
0030          do { node_count = 0; } while(synctex_NO)
0031 @@ -472,7 +472,7 @@ DEFINE_SYNCTEX_TREE_GETSET(target)
0032  #   define SYNCTEX_INIT_NODE_COUNT
0033  #endif
0034  
0035 -#if SYNCTEX_USE_NODE_COUNT>10
0036 +#if defined SYNCTEX_USE_NODE_COUNT && SYNCTEX_USE_NODE_COUNT>10
0037  #   define SYNCTEX_DID_NEW(N)   _synctex_did_new(N)
0038  #   define SYNCTEX_WILL_FREE(N) _synctex_will_free(N)
0039  #else
0040 @@ -865,7 +865,7 @@ SYNCTEX_INLINE static void __synctex_sca
0041      node->class->scanner->handle = NNN;
0042  }
0043  #endif
0044 -#if SYNCTEX_USE_NODE_COUNT>10
0045 +#if defined SYNCTEX_USE_NODE_COUNT && SYNCTEX_USE_NODE_COUNT>10
0046  SYNCTEX_INLINE static void _synctex_did_new(synctex_node_p node) {
0047      printf("NODE CREATED # %i, %s, %p\n",
0048             (node->class->scanner->node_count)++,
0049 @@ -2516,7 +2516,7 @@ SYNCTEX_INLINE static synctex_nns_s _syn
0050  }
0051  static char * _synctex_node_abstract(synctex_node_p node);
0052  SYNCTEX_INLINE static synctex_node_p synctex_tree_set_friend(synctex_node_p node,synctex_node_p new_friend) {
0053 -#if SYNCTEX_DEBUG
0054 +#if defined SYNCTEX_DEBUG && SYNCTEX_DEBUG
0055      synctex_node_p F = new_friend;
0056      while (F) {
0057          if (node == F) {
0058 @@ -2545,7 +2545,7 @@ SYNCTEX_INLINE static synctex_node_p __s
0059          i = i%(node->class->scanner->number_of_lists);
0060          old = synctex_tree_set_friend(node,(node->class->scanner->lists_of_friends)[i]);
0061          (node->class->scanner->lists_of_friends)[i] = node;
0062 -#if SYNCTEX_DEBUG>500
0063 +#if defined SYNCTEX_DEBUG && SYNCTEX_DEBUG>500
0064          printf("tl(%i)=>",i);
0065          synctex_node_log(node);
0066          if (synctex_node_parent_form(node)) {
0067 @@ -4186,7 +4186,7 @@ static synctex_ns_s __synctex_parse_new_
0068      /*  Prepend this input node to the input linked list of the scanner */
0069      __synctex_tree_set_sibling(input,scanner->input);/* input has no parent */
0070      scanner->input = input;
0071 -#   if SYNCTEX_VERBOSE
0072 +#   ifdef SYNCTEX_VERBOSE
0073      synctex_node_log(input);
0074  #   endif
0075      return (synctex_ns_s){input,_synctex_next_line(scanner)};/*  read the line termination character, if any */
0076 @@ -5083,10 +5083,10 @@ content_loop:
0077       */
0078      /* forms are everywhere */
0079      ns = SYNCTEX_NS_NULL;
0080 -#if SYNCTEX_VERBOSE
0081 +#ifdef SYNCTEX_VERBOSE
0082      synctex_scanner_set_display_switcher(scanner,-1);
0083      printf("NEW CONTENT LOOP\n");
0084 -#if SYNCTEX_DEBUG>500
0085 +#if defined SYNCTEX_DEBUG && SYNCTEX_DEBUG>500
0086      synctex_node_display(sheet);
0087  #endif
0088  #endif
0089 @@ -5106,7 +5106,7 @@ content_loop:
0090                  }
0091                  parent = ns.node;
0092                  child = _synctex_tree_last(parent);
0093 -#   if SYNCTEX_VERBOSE
0094 +#   ifdef SYNCTEX_VERBOSE
0095                  synctex_node_log(parent);
0096  #   endif
0097                  input.node = _synctex_input_register_line(input.node,parent);
0098 @@ -5124,7 +5124,7 @@ content_loop:
0099                  }
0100                  child = parent;
0101                  parent = _synctex_tree_parent(child);
0102 -#   if SYNCTEX_VERBOSE
0103 +#   ifdef SYNCTEX_VERBOSE
0104                  synctex_node_log(child);
0105  #   endif
0106                  if (_synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {
0107 @@ -5166,7 +5166,7 @@ content_loop:
0108                  } else {
0109                      _synctex_error("Can't create box bdry record.");
0110                  }
0111 -#   if SYNCTEX_VERBOSE
0112 +#   ifdef SYNCTEX_VERBOSE
0113                  synctex_node_log(parent);
0114  #   endif
0115                  input.node = _synctex_input_register_line(input.node,parent);
0116 @@ -5238,7 +5238,7 @@ content_loop:
0117                      child = parent;
0118                      parent = _synctex_tree_parent(child);
0119                      _synctex_make_hbox_contain_box(parent,_synctex_data_box_V(child));
0120 -#   if SYNCTEX_VERBOSE
0121 +#   ifdef SYNCTEX_VERBOSE
0122                      synctex_node_log(child);
0123  #   endif
0124                  }
0125 @@ -5260,7 +5260,7 @@ content_loop:
0126                      _synctex_node_set_child(parent,ns.node);
0127                  }
0128                  child = ns.node;
0129 -#   if SYNCTEX_VERBOSE
0130 +#   ifdef SYNCTEX_VERBOSE
0131                  synctex_node_log(child);
0132  #   endif
0133                  input.node = _synctex_input_register_line(input.node,child);
0134 @@ -5282,7 +5282,7 @@ content_loop:
0135                  }
0136                  child = ns.node;
0137                  _synctex_make_hbox_contain_box(parent,_synctex_data_box(child));
0138 -#   if SYNCTEX_VERBOSE
0139 +#   ifdef SYNCTEX_VERBOSE
0140                  synctex_node_log(child);
0141  #   endif
0142                  input.node = _synctex_input_register_line(input.node,child);
0143 @@ -5305,7 +5305,7 @@ content_loop:
0144                      __synctex_node_make_friend_tlc(child);
0145                  }
0146                  _synctex_make_hbox_contain_box(parent,_synctex_data_xob(child));
0147 -#   if SYNCTEX_VERBOSE
0148 +#   ifdef SYNCTEX_VERBOSE
0149                  synctex_node_log(child);
0150  #   endif
0151                  input.node = _synctex_input_register_line(input.node,child);
0152 @@ -5327,7 +5327,7 @@ content_loop:
0153                      __synctex_node_make_friend_tlc(child);
0154                  }
0155                  _synctex_make_hbox_contain_point(parent,_synctex_data_point(child));
0156 -#   if SYNCTEX_VERBOSE
0157 +#   ifdef SYNCTEX_VERBOSE
0158                  synctex_node_log(child);
0159  #   endif
0160                  input.node = _synctex_input_register_line(input.node,child);
0161 @@ -5351,7 +5351,7 @@ content_loop:
0162                  /* Rules are sometimes far too big
0163  _synctex_make_hbox_contain_box(parent,_synctex_data_box(child));
0164                   */
0165 -#   if SYNCTEX_VERBOSE
0166 +#   ifdef SYNCTEX_VERBOSE
0167                  synctex_node_log(child);
0168  #   endif
0169                  input.node = _synctex_input_register_line(input.node,child);
0170 @@ -5373,7 +5373,7 @@ _synctex_make_hbox_contain_box(parent,_s
0171                      __synctex_node_make_friend_tlc(child);
0172                  }
0173                  _synctex_make_hbox_contain_point(parent,_synctex_data_point(child));
0174 -#   if SYNCTEX_VERBOSE
0175 +#   ifdef SYNCTEX_VERBOSE
0176                  synctex_node_log(child);
0177  #   endif
0178                  input.node = _synctex_input_register_line(input.node,child);
0179 @@ -5383,7 +5383,7 @@ _synctex_make_hbox_contain_box(parent,_s
0180  #      ifdef SYNCTEX_NOTHING
0181  #       pragma mark + SCAN FORM REF
0182  #   endif
0183 -#if SYNCTEX_DEBUG>500
0184 +#if defined SYNCTEX_DEBUG && SYNCTEX_DEBUG>500
0185              synctex_node_display(parent);
0186              synctex_node_display(child);
0187  #endif
0188 @@ -5406,7 +5406,7 @@ _synctex_make_hbox_contain_box(parent,_s
0189                      }
0190                      scanner->ref_in_sheet = child;
0191                  }
0192 -#   if SYNCTEX_VERBOSE
0193 +#   ifdef SYNCTEX_VERBOSE
0194                  synctex_node_log(child);
0195  #   endif
0196                  goto content_loop;
0197 @@ -5427,7 +5427,7 @@ _synctex_make_hbox_contain_box(parent,_s
0198                      __synctex_node_make_friend_tlc(child);
0199                  }
0200                  _synctex_make_hbox_contain_point(parent,_synctex_data_point(child));
0201 -#   if SYNCTEX_VERBOSE
0202 +#   ifdef SYNCTEX_VERBOSE
0203                  synctex_node_log(child);
0204  #   endif
0205                  input.node = _synctex_input_register_line(input.node,child);
0206 @@ -5536,7 +5536,7 @@ SYNCTEX_INLINE static synctex_ns_s __syn
0207                  sibling->line_index = arg_sibling->line_index;
0208              }
0209  #endif
0210 -#if SYNCTEX_DEBUG>500
0211 +#if defined SYNCTEX_DEBUG && SYNCTEX_DEBUG>500
0212              printf("!  Ref replacement:\n");
0213              synctex_node_log(ref);
0214              synctex_node_display(synctex_node_sibling(ref));
0215 @@ -5600,7 +5600,7 @@ SYNCTEX_INLINE static synctex_status_t _
0216              }
0217          }
0218          do {
0219 -#if SYNCTEX_DEBUG>500
0220 +#if defined SYNCTEX_DEBUG && SYNCTEX_DEBUG>500
0221              printf("POST PROCESSING %s\n",_synctex_node_abstract(proxy));
0222              {
0223                  int i,j = 0;
0224 @@ -5619,7 +5619,7 @@ SYNCTEX_INLINE static synctex_status_t _
0225              }
0226  #endif
0227              f(proxy);
0228 -#if SYNCTEX_DEBUG>500
0229 +#if defined SYNCTEX_DEBUG && SYNCTEX_DEBUG>500
0230              {
0231                  int i,j = 0;
0232                  for (i=0;i<proxy->class->scanner->number_of_lists;++i) {
0233 @@ -5638,7 +5638,7 @@ SYNCTEX_INLINE static synctex_status_t _
0234  #endif
0235              /*  Side effect: create the hierarchy on the fly */
0236              proxy = synctex_node_next(proxy); /*  Change is here */
0237 -#if SYNCTEX_DEBUG>500
0238 +#if defined SYNCTEX_DEBUG && SYNCTEX_DEBUG>500
0239              if (proxy) {
0240                  int i,j = 0;
0241                  for (i=0;i<proxy->class->scanner->number_of_lists;++i) {
0242 @@ -5670,7 +5670,7 @@ SYNCTEX_INLINE static synctex_status_t _
0243  SYNCTEX_INLINE static synctex_status_t _synctex_post_process(synctex_scanner_p scanner) {
0244      synctex_status_t status = SYNCTEX_STATUS_OK;
0245      synctex_ns_s ns = {NULL,SYNCTEX_STATUS_NOT_OK};
0246 -#if SYNCTEX_DEBUG>500
0247 +#if defined SYNCTEX_DEBUG && SYNCTEX_DEBUG>500
0248      printf("!  entering _synctex_post_process.\n");
0249      synctex_node_display(scanner->sheet);
0250      synctex_node_display(scanner->form);
0251 @@ -5681,7 +5681,7 @@ SYNCTEX_INLINE static synctex_status_t _
0252      if (ns.status<status) {
0253          status = ns.status;
0254      }
0255 -#if SYNCTEX_DEBUG>500
0256 +#if defined SYNCTEX_DEBUG && SYNCTEX_DEBUG>500
0257      printf("!  ref replaced in form _synctex_post_process.\n");
0258      synctex_node_display(scanner->form);
0259  #endif
0260 @@ -5703,7 +5703,7 @@ SYNCTEX_INLINE static synctex_status_t _
0261          status = ns.status;
0262      }
0263      scanner->ref_in_sheet = NULL;
0264 -#if SYNCTEX_DEBUG>500
0265 +#if defined SYNCTEX_DEBUG && SYNCTEX_DEBUG>500
0266      printf("!  ref replaced in sheet _synctex_post_process.\n");
0267      synctex_node_display(scanner->sheet);
0268  #endif
0269 @@ -5725,7 +5725,7 @@ SYNCTEX_INLINE static synctex_status_t _
0270          }
0271      }
0272  #endif
0273 -#if SYNCTEX_DEBUG>10000
0274 +#if defined SYNCTEX_DEBUG && SYNCTEX_DEBUG>10000
0275      {
0276          int i;
0277          for (i=0;i<scanner->number_of_lists;++i) {
0278 @@ -5746,7 +5746,7 @@ SYNCTEX_INLINE static synctex_status_t _
0279      if (ns.status<status) {
0280          status = ns.status;
0281      }
0282 -#if SYNCTEX_DEBUG>500
0283 +#if defined SYNCTEX_DEBUG && SYNCTEX_DEBUG>500
0284      printf("!  exiting _synctex_post_process.\n");
0285      synctex_node_display(scanner->sheet);
0286      synctex_node_display(scanner->form);
0287 @@ -5861,7 +5861,7 @@ int synctex_scanner_free(synctex_scanner
0288          synctex_iterator_free(scanner->iterator);
0289          free(scanner->output_fmt);
0290          free(scanner->lists_of_friends);
0291 -#if SYNCTEX_USE_NODE_COUNT>0
0292 +#if defined SYNCTEX_USE_NODE_COUNT && SYNCTEX_USE_NODE_COUNT>0
0293          node_count = scanner->node_count;
0294  #endif
0295          free(scanner);
0296 @@ -5919,7 +5919,7 @@ synctex_scanner_p synctex_scanner_parse(
0297      if (status<SYNCTEX_STATUS_OK) {
0298          _synctex_error("Bad postamble. Ignored\n");
0299      }
0300 -#if SYNCTEX_DEBUG>500
0301 +#if defined SYNCTEX_DEBUG && SYNCTEX_DEBUG>500
0302      synctex_scanner_set_display_switcher(scanner, 100);
0303      synctex_node_display(scanner->sheet);
0304      synctex_node_display(scanner->form);
0305 @@ -8048,7 +8048,7 @@ static synctex_nd_s __synctex_closest_de
0306                 SYNCTEX_LINEINDEX(node));
0307  #endif
0308          do {
0309 -#if SYNCTEX_DEBUG>500
0310 +#if defined SYNCTEX_DEBUG && SYNCTEX_DEBUG>500
0311              synctex_node_display(child);
0312  #endif
0313              synctex_nd_s nd = SYNCTEX_ND_0;
0314 Index: synctex/synctex_parser_utils.c
0315 ===================================================================
0316 --- synctex.orig/synctex_parser_utils.c
0317 +++ synctex/synctex_parser_utils.c
0318 @@ -129,7 +129,7 @@ int _synctex_log(int level, const char *
0319                 OutputDebugStringA("\n");
0320                 free(buff);
0321         }
0322 -#   elif SYNCTEX_USE_SYSLOG
0323 +#   elif defined SYNCTEX_USE_SYSLOG
0324      char * buffer1 = NULL;
0325      char * buffer2 = NULL;
0326      openlog ("SyncTeX", LOG_CONS | LOG_PID | LOG_PERROR | LOG_NDELAY, LOG_LOCAL0);