Details

    • Type: Task Task
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3.1
    • Component/s: Cleanup
    • Labels:
      None

      Description

      in RecCore.*

      int RecGetRecordInt(const char *name, RecInt * rec_int, bool lock = true);
      //-------------------------------------------------------------------------
      // RecGetRecordXXX
      //-------------------------------------------------------------------------
      int
      RecGetRecordInt(const char *name, RecInt *rec_int, bool lock)
      {
        int err;
        RecData data;
        if ((err = RecGetRecord_Xmalloc(name, RECD_INT, &data, lock)) == REC_ERR_OKAY)
          *rec_int = data.rec_int;
        return err;
      }
      

      and there is something heavy used:

      //-------------------------------------------------------------------------
      // Backwards Compatibility Items (REC_ prefix)
      //-------------------------------------------------------------------------
      #define REC_ReadConfigInt32(_var,_config_var_name) do { \
        RecInt tmp = 0; \
        RecGetRecordInt(_config_var_name, (RecInt*) &tmp); \
        _var = (int32_t)tmp; \
      } while (0)
      
      #define REC_ReadConfigInteger(_var,_config_var_name) do { \
        RecInt tmp = 0; \
        RecGetRecordInt(_config_var_name, &tmp); \
        _var = tmp; \
      } while (0)
      

      and a real case, the REC_ReadConfigInteger is renamed to IOCORE_ReadConfigInteger:

      RecInt cache_config_threads_per_disk = 12;
      #define IOCORE_ReadConfigInteger            REC_ReadConfigInteger
        IOCORE_ReadConfigInteger(cache_config_threads_per_disk, "proxy.config.cache.threads_per_disk");
      

      my question is, why it is so complex in all these renaming? why not just:

      RecGetRecordInt("proxy.config.cache.threads_per_disk", &cache_config_threads_per_disk);
      

      brief talk with Leif, we may need to cleanup the use of REC_*. make it a small task here

        Issue Links

        There are no Sub-Tasks for this issue.

          Activity

            People

            • Assignee:
              Zhao Yongming
              Reporter:
              Zhao Yongming
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development