@@ -104,17 +104,17 @@ void gi_folder_map_read(const void *buf, size_t bufsize, gi_folder_map_t &map)
104104 EXT_PULL ep;
105105 ep.init (buf, bufsize, zalloc, EXT_FLAG_WCOUNT);
106106 uint64_t max = 0 ;
107- if (ep.g_uint64 (&max) != EXT_ERR_SUCCESS )
107+ if (ep.g_uint64 (&max) != pack_result::ok )
108108 throw YError (" PG-1100" );
109109 for (size_t n = 0 ; n < max; ++n) {
110110 uint32_t nid;
111111 uint8_t create;
112112 uint64_t fidto;
113113 std::unique_ptr<char [], gi_delete> name;
114- if (ep.g_uint32 (&nid) != EXT_ERR_SUCCESS ||
115- ep.g_uint8 (&create) != EXT_ERR_SUCCESS ||
116- ep.g_uint64 (&fidto) != EXT_ERR_SUCCESS ||
117- ep.g_str (&unique_tie (name)) != EXT_ERR_SUCCESS )
114+ if (ep.g_uint32 (&nid) != pack_result::ok ||
115+ ep.g_uint8 (&create) != pack_result::ok ||
116+ ep.g_uint64 (&fidto) != pack_result::ok ||
117+ ep.g_str (&unique_tie (name)) != pack_result::ok )
118118 throw YError (" PG-1101" );
119119 map.insert_or_assign (nid, tgt_folder{static_cast <bool >(create), fidto, name != nullptr ? name.get () : " " });
120120 }
@@ -125,13 +125,13 @@ void gi_folder_map_write(const gi_folder_map_t &map)
125125 EXT_PUSH ep;
126126 if (!ep.init (nullptr , 0 , EXT_FLAG_WCOUNT))
127127 throw std::bad_alloc ();
128- if (ep.p_uint64 (map.size ()) != EXT_ERR_SUCCESS )
128+ if (ep.p_uint64 (map.size ()) != pack_result::ok )
129129 throw YError (" PG-1102" );
130130 for (const auto &[nid, tgt] : map)
131- if (ep.p_uint32 (nid) != EXT_ERR_SUCCESS ||
132- ep.p_uint8 (!!tgt.create ) != EXT_ERR_SUCCESS ||
133- ep.p_uint64 (tgt.fid_to ) != EXT_ERR_SUCCESS ||
134- ep.p_str (tgt.create_name .c_str ()) != EXT_ERR_SUCCESS )
131+ if (ep.p_uint32 (nid) != pack_result::ok ||
132+ ep.p_uint8 (!!tgt.create ) != pack_result::ok ||
133+ ep.p_uint64 (tgt.fid_to ) != pack_result::ok ||
134+ ep.p_str (tgt.create_name .c_str ()) != pack_result::ok )
135135 throw YError (" PG-1103" );
136136 uint64_t xsize = cpu_to_le64 (ep.m_offset );
137137 if (HXio_fullwrite (STDOUT_FILENO, &xsize, sizeof (xsize)) < 0 )
@@ -145,13 +145,13 @@ void gi_name_map_read(const void *buf, size_t bufsize, gi_name_map &map)
145145 EXT_PULL ep;
146146 ep.init (buf, bufsize, zalloc, EXT_FLAG_WCOUNT);
147147 uint64_t max = 0 ;
148- if (ep.g_uint64 (&max) != EXT_ERR_SUCCESS )
148+ if (ep.g_uint64 (&max) != pack_result::ok )
149149 throw YError (" PG-1108" );
150150 for (size_t n = 0 ; n < max; ++n) {
151151 proptag_t proptag;
152152 PROPERTY_NAME propname{};
153- if (ep.g_uint32 (&proptag) != EXT_ERR_SUCCESS ||
154- ep.g_propname (&propname) != EXT_ERR_SUCCESS )
153+ if (ep.g_uint32 (&proptag) != pack_result::ok ||
154+ ep.g_propname (&propname) != pack_result::ok )
155155 throw YError (" PG-1109" );
156156 try {
157157 map.insert_or_assign (proptag, propname);
@@ -168,13 +168,13 @@ void gi_name_map_write(const gi_name_map &map)
168168 EXT_PUSH ep;
169169 if (!ep.init (nullptr , 0 , EXT_FLAG_WCOUNT))
170170 throw std::bad_alloc ();
171- if (ep.p_uint64 (map.size ()) != EXT_ERR_SUCCESS )
171+ if (ep.p_uint64 (map.size ()) != pack_result::ok )
172172 throw YError (" PG-1110" );
173173 for (const auto &[proptag, xn] : map) {
174174 static_assert (sizeof (gi_name_map::key_type) == sizeof (uint32_t ),
175175 " Something is fishy with the definition of gi_name_map" );
176176 if (ep.p_uint32 (proptag) != pack_result::ok ||
177- ep.p_propname (static_cast <PROPERTY_NAME>(xn)) != EXT_ERR_SUCCESS )
177+ ep.p_propname (static_cast <PROPERTY_NAME>(xn)) != pack_result::ok )
178178 throw YError (" PG-1111" );
179179 }
180180 uint64_t xsize = cpu_to_le64 (ep.m_offset );
@@ -208,7 +208,7 @@ int exm_set_change_keys(TPROPVAL_ARRAY *props, eid_t change_num)
208208 BINARY bxid;
209209 EXT_PUSH ep;
210210 if (!ep.init (tmp_buff, std::size (tmp_buff), 0 ) ||
211- ep.p_xid (zxid) != EXT_ERR_SUCCESS ) {
211+ ep.p_xid (zxid) != pack_result::ok ) {
212212 fprintf (stderr, " exm: ext_push: ENOMEM\n " );
213213 return -ENOMEM;
214214 }
@@ -381,7 +381,7 @@ int exm_create_msg(uint64_t parent_fld, MESSAGE_CONTENT *ctnt)
381381 BINARY bxid;
382382 EXT_PUSH ep;
383383 if (!ep.init (tmp_buff, std::size (tmp_buff), 0 ) ||
384- ep.p_xid (zxid) != EXT_ERR_SUCCESS ) {
384+ ep.p_xid (zxid) != pack_result::ok ) {
385385 fprintf (stderr, " exm: ext_push: ENOMEM\n " );
386386 return -ENOMEM;
387387 }
0 commit comments