Changeset 7470 for trunk/ippTools/src/dettool.c
- Timestamp:
- Jun 9, 2006, 3:57:59 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/dettool.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/dettool.c
r7424 r7470 1785 1785 1786 1786 1787 static bool rerunMode (pxConfig *config)1787 static bool rerunMode1(pxConfig *config) 1788 1788 { 1789 1789 PS_ASSERT_PTR_NON_NULL(config, false); … … 1808 1808 return false; 1809 1809 } 1810 ps Metadata *where = psMetadataAlloc();1810 psList *exp_id_list = item->data.list; 1811 1811 1812 1812 // make sure that -exp_id was parsed correctly 1813 1813 // XXX this can be removed someday 1814 1814 if (item->type == PS_DATA_METADATA_MULTI) { 1815 psListIterator *iter = psListIteratorAlloc( item->data.list, 0, false);1815 psListIterator *iter = psListIteratorAlloc(exp_id_list, 0, false); 1816 1816 psMetadataItem *mItem = NULL; 1817 1817 while ((mItem = psListGetAndIncrement(iter))) { 1818 1818 psString exp_id = mItem->data.V; 1819 1819 // if exp_id is NULL then it means that -exp_id has not been 1820 // specified 1820 // specified or something really bad happened 1821 1821 if (!exp_id) { 1822 1822 psError(PS_ERR_UNKNOWN, true, 1823 1823 "at least one -exp_id is required"); 1824 psFree(where);1825 return false;1826 }1827 1828 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id",1829 PS_META_DUPLICATE_OK, "==", exp_id)) {1830 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");1831 psFree(iter);1832 psFree(where);1833 1824 return false; 1834 1825 } … … 1840 1831 } 1841 1832 1842 if (where->list->n < 1) {1843 psFree(where);1844 where = NULL;1845 }1846 1847 1833 // check that the specified exp_ids actually exist in the iteration zero 1848 1834 // detInputExp set 1849 1835 1850 1836 // add the det_id & iteration == 0 to the where claus 1837 psMetadata *where = psMetadataAlloc(); 1851 1838 if (!psMetadataAddS32(where, PS_LIST_TAIL, "det_id", 0, "==", 1852 1839 (psS32)atol(det_id))) { … … 1868 1855 } 1869 1856 1870 return true; 1871 } 1857 // build a hash for the valid exp_ids 1858 psHash *valid_exp_ids = psHashAlloc(psArrayLength(detrendExps)); 1859 for (long i = 0; i < psArrayLength(detrendExps); i++) { 1860 psHashAdd(valid_exp_ids, 1861 ((detInputExpRow *)detrendExps->data[i])->exp_id, 1862 ((detInputExpRow *)detrendExps->data[i])->exp_id 1863 ); 1864 } 1865 1866 psListIterator *iter = psListIteratorAlloc(exp_id_list, 0, false); 1867 psMetadataItem *mItem = NULL; 1868 while ((mItem = psListGetAndIncrement(iter))) { 1869 if (!psHashLookup(valid_exp_ids, (char *)mItem->data.V)) { 1870 // invalid exp_id 1871 psError(PS_ERR_UNKNOWN, false, "exp_id %s is invalid for det_id %s", 1872 (char *)mItem->data.V, det_id); 1873 psFree(valid_exp_ids); 1874 psFree(iter); 1875 return false; 1876 } 1877 } 1878 psFree(valid_exp_ids); 1879 psFree(iter); 1880 1881 psFree(exp_id_list); 1882 1883 return true; 1884 }
Note:
See TracChangeset
for help on using the changeset viewer.
