Changeset 18336 for trunk/ippTools/src/pxtools.h
- Timestamp:
- Jun 26, 2008, 3:39:54 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/pxtools.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/pxtools.h
r18029 r18336 36 36 #include "pxfake.h" 37 37 #include "pxwarp.h" 38 #include "pxio.h"39 38 #include "pxregister.h" 40 39 #include "pxtag.h" … … 109 108 type var; \ 110 109 { \ 111 bool status; \ 112 \ 113 var = psMetadataLookup##suffix(&status, md, key); \ 114 if (!status) { \ 115 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for %s", key); \ 116 return ret; \ 117 } \ 118 \ 119 if (required && (var == max)) { \ 120 psError(PS_ERR_UNKNOWN, true, "%s is required", key); \ 121 return ret; \ 122 } \ 110 psMetadataItem *item = psMetadataLookup(md, key); \ 111 if (!item) { \ 112 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for %s", key); \ 113 return ret; \ 114 } \ 115 psAssert(item->comment, "metadata item comment should be defined"); \ 116 if (required && (!psStrcasestr(item->comment, "(found)"))) { \ 117 psError(PS_ERR_UNKNOWN, true, "%s is required", key); \ 118 return ret; \ 119 } \ 120 \ 121 var = item->data.suffix; \ 122 \ 123 123 } 124 124 … … 172 172 // XXX the PXOPT_COPY_* macros free 'to' on error 173 173 174 #define PXOPT_COPY_PRIMITIVE(from, to, type, suffix, oldname, newname, comment) \ 175 { \ 176 bool status = false; \ 177 type var = psMetadataLookup##suffix(&status, from, oldname); \ 178 if (!status) { \ 179 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for " oldname); \ 174 #define PXOPT_COPY_PRIMITIVE(from, to, type, suffix, oldname, newname, newcomment) \ 175 { \ 176 psMetadataItem *item = psMetadataLookup(from, oldname); \ 177 if (!item) { \ 178 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for %s", oldname); \ 180 179 return false; \ 181 180 } \ 182 if (!psMetadataAdd##suffix(to, PS_LIST_TAIL, newname, PS_META_DUPLICATE_OK, comment, var)) { \ 183 psError(PS_ERR_UNKNOWN, false, "failed to add item " newname); \ 184 psFree(to); \ 185 return false; \ 181 psAssert(item->comment, "metadata item comment should be defined"); \ 182 \ 183 if (psStrcasestr(item->comment, "(found)")) { \ 184 if (!psMetadataAdd##suffix(to, PS_LIST_TAIL, newname, PS_META_DUPLICATE_OK, newcomment, item->data.suffix)) { \ 185 psError(PS_ERR_UNKNOWN, false, "failed to add item " newname); \ 186 psFree(to); \ 187 return false; \ 188 } \ 186 189 } \ 187 190 }
Note:
See TracChangeset
for help on using the changeset viewer.
