VirtualBox

Changeset 16742 in vbox


Ignore:
Timestamp:
Feb 13, 2009 3:21:11 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
42783
Message:

Correct some typos in comments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/com/array.h

    r16671 r16742  
    755755     * existing value to the array element, for example:
    756756     * <tt>Bstr string; array.push_back (string);</tt>. If you create a string
    757      * just to put it to the array, you may find #appendedRaw() more useful.
     757     * just to put it in the array, you may find #appendedRaw() more useful.
    758758     *
    759759     * @param aElement Element to append.
    760760     *
    761      * @return          @c true on success and false if there is not enough
     761     * @return          @c true on success and @c false if there is not enough
    762762     *                  memory for resizing.
    763763     */
     
    789789     *
    790790     * This method is handy for operations like
    791      * <tt>Bstr ("foo").detacTo (array.appendedRaw());</tt>. Don't use it as
    792      * l-value (<tt>array.appendedRaw() = SysAllocString (L"tralala");</tt>)
     791     * <tt>Bstr ("foo").detachTo (array.appendedRaw());</tt>. Don't use it as
     792     * an l-value (<tt>array.appendedRaw() = SysAllocString (L"tralala");</tt>)
    793793     * since this doesn't check for a NULL condition; use #resize() and
    794794     * #setRawAt() instead. If you need to assign a copy of the existing value
     
    815815    /**
    816816     * Resizes the array preserving its contents when possible. If the new size
    817      * is larget than the old size, new elements are initialized with null
     817     * is larger than the old size, new elements are initialized with null
    818818     * values. If the new size is less than the old size, the contents of the
    819819     * array beyond the new size is lost.
    820820     *
    821821     * @param aNewSize  New number of elements in the array.
    822      * @return          @c true on success and false if there is not enough
     822     * @return          @c true on success and @c false if there is not enough
    823823     *                  memory for resizing.
    824824     */
     
    850850     *
    851851     * @param aNewSize  New number of elements in the array.
    852      * @return          @c true on success and false if there is not enough
     852     * @return          @c true on success and @c false if there is not enough
    853853     *                  memory for resizing.
    854854     */
     
    933933     * @note It is assumed that the ownership of the returned copy is
    934934     * transferred to the caller of the method and he is responsible to free the
    935      * array data when it is no more necessary.
     935     * array data when it is no longer needed.
    936936     *
    937937     * @param aArg  Output method parameter to clone to.
     
    963963     * @note Since the ownership of the array data is transferred to the
    964964     * caller of the method, he is responsible to free the array data when it is
    965      * no more necessary.
     965     * no longer needed.
    966966     *
    967967     * @param aArg  Location to detach to.
     
    10031003    }
    10041004
    1005     // public methods for internal purposes only
     1005    // Public methods for internal purposes only.
    10061006
    10071007#if defined (VBOX_WITH_XPCOM)
     
    10311031
    10321032    /**
    1033      * Ensures that the array is big enough to contaon aNewSize elements.
     1033     * Ensures that the array is big enough to contain aNewSize elements.
    10341034     *
    10351035     * If the new size is greater than the current capacity, a new array is
    1036      * allocated and elements from the old array are copied over. The  size of
     1036     * allocated and elements from the old array are copied over. The size of
    10371037     * the array doesn't change, only the capacity increases (which is always
    10381038     * greater than the size). Note that the additionally allocated elements are
     
    10621062            return true;
    10631063
    1064         /* allocate in 16-byte pieces */
     1064        /* Allocate in 16-byte pieces. */
    10651065        size_t newCapacity = RT_MAX ((aNewSize + 15) / 16 * 16, 16);
    10661066
     
    10741074                if (m.size > aNewSize)
    10751075                {
    1076                     /* truncation takes place, uninit exceeding elements and
    1077                      * shrink the size */
     1076                    /* Truncation takes place, uninit exceeding elements and
     1077                     * shrink the size. */
    10781078                    for (size_t i = aNewSize; i < m.size; ++ i)
    10791079                        Uninit (m.arr [i]);
     
    10821082                }
    10831083
    1084                 /* copy the old contents */
     1084                /* Copy the old contents. */
    10851085                memcpy (newArr, m.arr, m.size * sizeof (T));
    10861086                nsMemory::Free ((void *) m.arr);
     
    10931093            if (m.size > aNewSize)
    10941094            {
    1095                 /* truncation takes place, uninit exceeding elements and
    1096                  * shrink the size */
     1095                /* Truncation takes place, uninit exceeding elements and
     1096                 * shrink the size. */
    10971097                for (size_t i = aNewSize; i < m.size; ++ i)
    10981098                    Uninit (m.arr [i]);
     
    12211221 * ComSafeArrayIn* and ComSafeArrayOut*. Another important nuance is that the
    12221222 * raw() array type is different (nsID **, or GUID ** on XPCOM and GUID * on MS
    1223  * COM) so it is recommended to use operator[] instead that always returns a
     1223 * COM) so it is recommended to use operator[] instead which always returns a
    12241224 * GUID by value.
    12251225 *
     
    12771277    /**
    12781278     * Array access operator that returns an array element by reference. As a
    1279      * special case, the return value of this operator on XPCOM is a nsID (GUID)
    1280      * reference, instead of a nsID pointer (the actual SafeArray template
     1279     * special case, the return value of this operator on XPCOM is an nsID (GUID)
     1280     * reference, instead of an nsID pointer (the actual SafeArray template
    12811281     * argument), for compatibility with the MS COM version.
    12821282     *
     
    13371337private:
    13381338
    1339     /* These are disabled because of const */
     1339    /* These are disabled because of const. */
    13401340    bool reset (size_t aNewSize) { NOREF (aNewSize); return false; }
    13411341};
     
    14611461     *
    14621462     * Note that this constructor doesn't take the ownership of the array. In
    1463      * particular, it means that operations that operate on the ownership (e.g.
    1464      * #detachTo()) are forbidden and will assert.
     1463     * particular, this means that operations that operate on the ownership
     1464     * (e.g. #detachTo()) are forbidden and will assert.
    14651465     *
    14661466     * @param aArg  Input method parameter to attach to.
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette