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