/[svn]/linuxsampler/trunk/src/scriptvm/common.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/scriptvm/common.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3012 by schoenebeck, Wed Oct 12 12:50:37 2016 UTC revision 3056 by schoenebeck, Fri Dec 16 12:57:59 2016 UTC
# Line 157  namespace LinuxSampler { Line 157  namespace LinuxSampler {
157           * expressions to an array expression for you, instead this method will           * expressions to an array expression for you, instead this method will
158           * simply return NULL!           * simply return NULL!
159           *           *
160             * @b Note: this method is currently, and in contrast to its other
161             * counter parts, declared as virtual method. Some deriving classes are
162             * currently using this to override this default implementation in order
163             * to implement an "evaluate now as integer array" behavior. This has
164             * efficiency reasons, however this also currently makes this part of
165             * the API less clean and should thus be addressed in future with
166             * appropriate changes to the API.
167             *
168           * @see exprType()           * @see exprType()
169           */           */
170          VMIntArrayExpr* asIntArray() const;          virtual VMIntArrayExpr* asIntArray() const;
171    
172          /**          /**
173           * Returns true in case this expression can be considered to be a           * Returns true in case this expression can be considered to be a
# Line 539  namespace LinuxSampler { Line 547  namespace LinuxSampler {
547          }          }
548      };      };
549    
550        #if HAVE_CXX_EMBEDDED_PRAGMA_DIAGNOSTICS
551        # define COMPILER_DISABLE_OFFSETOF_WARNING                    \
552            _Pragma("GCC diagnostic push")                            \
553            _Pragma("GCC diagnostic ignored \"-Winvalid-offsetof\"")
554        # define COMPILER_RESTORE_OFFSETOF_WARNING \
555            _Pragma("GCC diagnostic pop")
556        #else
557        # define COMPILER_DISABLE_OFFSETOF_WARNING
558        # define COMPILER_RESTORE_OFFSETOF_WARNING
559        #endif
560    
561      /**      /**
562       * Convenience macro for initializing VMIntRelPtr and VMInt8RelPtr       * Convenience macro for initializing VMIntRelPtr and VMInt8RelPtr
563       * structures. Usage example:       * structures. Usage example:
# Line 581  namespace LinuxSampler { Line 600  namespace LinuxSampler {
600       * complexity inside the sampler engines which provide the actual script       * complexity inside the sampler engines which provide the actual script
601       * functionalities.       * functionalities.
602       */       */
603      #define DECLARE_VMINT(basePtr, T_struct, T_member) ( \      #define DECLARE_VMINT(basePtr, T_struct, T_member) (          \
604          (VMRelPtr) {                                     \          /* Disable offsetof warning, trust us, we are cautios. */ \
605              (void**) &basePtr,                           \          COMPILER_DISABLE_OFFSETOF_WARNING                         \
606              offsetof(T_struct, T_member),                \          (VMRelPtr) {                                              \
607              false                                        \              (void**) &basePtr,                                    \
608          }                                                \              offsetof(T_struct, T_member),                         \
609      )                                                    \              false                                                 \
610            }                                                         \
611            COMPILER_RESTORE_OFFSETOF_WARNING                         \
612        )                                                             \
613    
614      /**      /**
615       * Same as DECLARE_VMINT(), but this one defines the VMIntRelPtr and       * Same as DECLARE_VMINT(), but this one defines the VMIntRelPtr and
# Line 603  namespace LinuxSampler { Line 625  namespace LinuxSampler {
625       * @see ScriptVM::builtInConstIntVariables()       * @see ScriptVM::builtInConstIntVariables()
626       */       */
627      #define DECLARE_VMINT_READONLY(basePtr, T_struct, T_member) ( \      #define DECLARE_VMINT_READONLY(basePtr, T_struct, T_member) ( \
628          (VMRelPtr) {                                          \          /* Disable offsetof warning, trust us, we are cautios. */ \
629              (void**) &basePtr,                                \          COMPILER_DISABLE_OFFSETOF_WARNING                         \
630              offsetof(T_struct, T_member),                     \          (VMRelPtr) {                                              \
631              true                                              \              (void**) &basePtr,                                    \
632          }                                                     \              offsetof(T_struct, T_member),                         \
633      )                                                         \              true                                                  \
634            }                                                         \
635            COMPILER_RESTORE_OFFSETOF_WARNING                         \
636        )                                                             \
637    
638      /** @brief Built-in VM 8 bit integer array variable.      /** @brief Built-in VM 8 bit integer array variable.
639       *       *
# Line 708  namespace LinuxSampler { Line 733  namespace LinuxSampler {
733           * @param expr - new value to be assigned to this variable           * @param expr - new value to be assigned to this variable
734           */           */
735          void assignExpr(VMExpr* expr) OVERRIDE {}          void assignExpr(VMExpr* expr) OVERRIDE {}
736    
737            virtual ~VMDynVar() {}
738      };      };
739    
740      /** @brief Dynamically executed variable (of integer data type).      /** @brief Dynamically executed variable (of integer data type).

Legend:
Removed from v.3012  
changed lines
  Added in v.3056

  ViewVC Help
Powered by ViewVC