dst[d_idx] = (uint8_t)(dst[d_idx] | (((src[s_idx] >> src_offset) & (uint8_t)mask) << dst_offset));
 
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Copyright by The HDF Group.                                               *
 * Copyright by the Board of Trustees of the University of Illinois.         *
 * All rights reserved.                                                      *
 *                                                                           *
 * This file is part of HDF5.  The full HDF5 copyright notice, including     *
 * terms governing use, modification, and redistribution, is contained in    *
 * the COPYING file, which can be found at the root of the source code       *
 * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.  *
 * If you do not have access to either file, you may request a copy from     *
 * help@hdfgroup.org.                                                        *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* Module Info: Operations on bit vectors.  A bit vector is an array of bytes
 *              with the least-significant bits in the first byte.  That is,
 *              the bytes are in little-endian order.
 */
#include "H5Tmodule.h"          /* This source code file is part of the H5T module */
#include "H5private.h"      /*generic functions           */
#include "H5Eprivate.h"     /*error handling              */
#include "H5MMprivate.h"    /* Memory management            */
#include "H5Tpkg.h"     /*data-type functions             */
#include "H5WBprivate.h"        /* Wrapped Buffers                      */
/*-------------------------------------------------------------------------
 * Function:    H5T__bit_copy
 *
 * Purpose:     Copies bits from one vector to another.
 *
 * Return:      void
 *
 *-------------------------------------------------------------------------
 */
void
H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src,
    size_t src_offset, size_t size)
    size_t  shift;
    size_t  mask_lo, mask_hi;
    size_t  s_idx, d_idx;
    FUNC_ENTER_PACKAGE_NOERR
    /* Normalize the offset to be a byte number and a bit offset within that
     * byte.
     */